On Mon, Jul 4, 2011 at 1:44 PM, Mark Rathwell <mark.rathw...@gmail.com> wrote: > > A function is a function, whether it is bound to a Var or not. I think that > was Ken's point, that you need to wrap a Java method in a function > (anonymous or named) in order to pass to an HOF, as Java methods are not > first class. So, that is one instance where a function whose sole purpose > is to wrap a Java method may make sense.
Exactly. A related case may be when you're not making just a straight wrapper, but adding something -- your own pre/post checks, or argument transformations, or etc. As for binding to a Var, that makes sense if the result is not as trivial as #(.meth %) and is going to be used many times. Otherwise #(.meth %) is not much longer than a reasonably clear Var name for it and is crystal clear as to what it does, so I'd just use that. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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