On Wed, May 16, 2012 at 1:57 PM, Murtaza Husain
<murtaza.hus...@sevenolives.com> wrote:
> What is the idiomatic use of partial. I understand it helps create closures,
> however the reader notation also allows to the same. So when should partial
> be use dover other forms of creating functions.

I have no idea if it is idiomatic or not but I've come to use partial
whenever I want to use a function with the leading arguments fixed.
The only times I use the `#` reader macro is when I need to fix an
argument that's after the argument I want to map over or utilize. I
find partial to signal my intent better in the cases where I'm trying
to say "give me a new function with leading arguments fixed" vs. the
reader macro which doesn't really signal my intent at all other than
that I want an anonymous function that may do anything at all. Also
partial clearly indicates that I'm doing a higher-order operation on
an existing function which could lead to less cognitive overload, I
suppose, when reading the code later on whereas the reader macro sort
of has to be read thoroughly in order to understand what I was trying
to do.

Just my 2 cents.

-- 
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

Reply via email to