There is a subtle difference in how fixed arguments are handled.
partial evaluates the arguments only once while fn evaluates them on
each call. For side-effects free code the former can yield better
performance. To recap:

(partial foo (baz 1 2))

==

(let [b (baz 1 2)]
  (fn [& x] (apply foo b x))

As for syntax sugar, I would like to see the #() macro to be extended
so that it curries when no implicit arguments are given:

#(foo bar baz) => #(foo bar baz &%)

whilst keeping (and emphasising) partial for cases where evaluate-once
semantics are required.

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