On Thursday, October 27, 2016 at 11:39:27 AM UTC-5, Alan Thompson wrote:
>
> I almost never use either the `comp` or the `partial` functions.  I think 
> it is clearer to either compose the functions like Gary showed, or to use a 
> threading macro (my favorite is the `it->` macro from the Tupelo library 
> <https://github.com/cloojure/tupelo#literate-threading-macro>).
> Alan
>

I may be weird, but I almost never use the threading macros, and routinely 
use comp and partial, often with map. I often order function parameters in 
my definitions to facilitate the use of partial.  I don't mind reading 
functions "backwards" in a long chain of function calls, even though I 
sometimes use threading macros. I think this is just a matter of taste and 
past experience.

I agree that it can be clearer sometimes to arrange function calls 
"forward" in the order in which they're called.  Obviously, a (small) 
disadvantage of e.g. -> and ->> macros is that they depend on having a 
series of function calls in which it's the same argument (1st, or last) 
that has to be passed on (although you can wrap the calls in e.g. #() to 
fudge that).  I think that for a new user it's probably a little bit 
confusing with -> to have a series of function calls in which there's a 
hidden argument right after the function name.  With normal function 
composition, all arguments are explicit, and you can pass the result of any 
function call as any argument.  I don't think anyone would disagree with 
these points.  Taste and past experience.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to