Hi,
Why not do things the other way around, and instead using partial to
curry the first argument, just repeat it as the second argument. i.e.,
(map + [1 2 3] (repeat 3)) . This approach seems to me as much more
readable and clean.
Yoav
On Dec 29, 4:22 pm, Jay Fields wrote:
> Sorry if this has
Sorry if this has already been addressed...
I can understand both Ron's pain and the reasoning why it's not possible to
have Haskell style currying; however, I wonder if there's a compromise
possible.
Right now, we:
(map #(+ 3 %) [1 2 3] or (map (partial + 3) [1 2 3])
The (partial + 3) is a b
This is definitely not a JVM limitation, it is a design choice. There
are lisps that have automatic currying, e.g., Qi (http://
en.wikipedia.org/wiki/Qi_(programming_language)).
I think the main issue, why this is not convenient, is that Clojure
functions tend to accept a variable number of argumen
(+ 3) already has a meaning in Clojure. It's an expression whose
answer is 3. How is Clojure supposed to read your mind and know that
you want the output to be a function there?
Similarly, would (+ 3 2) be 5, or would it be the curried function of
+ applied to 3 and 2 and waiting for more parame
Hi everybody..I've a little question..the way in than clojure
implement curry is affected for the jvm or it is a "Rick
decision" ...in haskell every function accept only one parameter and
if you call a function with >1 parameter it use currying...I feel than
it is really natural and more clean than