4 ms·
Hm I do not agree with you re: `->` and `->>`, and have had no problems with Clojure's context-managing fns (though my experience is limited). Not sure how they
by mattdeboard 15y ago
Hm I do not agree with you re: `->` and `->>`, and have had no problems with Clojure's context-managing fns (though my experience is limited). Not sure how they're "leaky" at all. They do require a little getting used to but once you understand what's happening they're great.
I say that mostly as someone who is very picky about how his code looks, especially with regard to whitespace, keeping line length under 80 columns, and so forth. The threading macros are great for presenting code in a very readable way.
- calibraxis 15y agoYes, and I also think that this discussion needs to mention the facilities Clojure provides to help you with macros. For example, with simpler macros like -> and ->>, I recommend that curious people macroexpand them, to get a feel for what they mean. Your GUI can make this even easier, like if I put the cursor at the beginning of the following and hit M-x slime-macroexpand-all: (-> my_table (database db/*stage-db*) select* exec) I see: (exec (select* (database my_table *stage-db*))) Or if I do M-. , I get to see the sourcecode. This of course is daunting to beginners, but they can easily mess with the sourcecode, tear it apart, and get to the level where they can just kind of scan smaller macros and get a rough idea of how it's doing its job. (I realize the author probably knows these things. But I definitely consider -> and ->> to be such a readability win, and hope that people like them.)