>From a practical position, anonymous functions of the #(+ 5 %) flavor *are* partial application. The ubiquity of these anonymous functions in clojure code is evidence that partial application is just as needed in clojure as it is in haskell. #(+ 5 %) is not much more succinct than (\x -> x + 5). However in haskell partial application is the default; no 'partial' function or operator is needed as + 5 is the partial application of +. In conclusion, we often need partial application in both languages and the succinctness of expression in each language causes practitioners to choose true partial application versus anonymous functions. If clojure used partial application by default, then we would see fewer anonymous functions in clojure code; if haskell did not use partial application by default, we would see more anonymous functions in haskell code.
On May 29, 10:40 pm, Vagif Verdi <vagif.ve...@gmail.com> wrote: > On May 27, 11:57 pm, kinghajj <kingh...@gmail.com> wrote: > > > Example: > > (def add5 ($ + 5)) > > > (add5 3) > > I love partial application in haskell. But do not see the need for it > in clojure with its succinct syntax for anonymous functions: > > (def add5 #(+ 5 %1)) > > (add5 3) > > Besides clojure's anonymous function syntax allows you to replace any > argument, not just the last one, like your partial macro. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---