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 <j...@jayfields.com> wrote:
> 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 bit too verbose for me, and I can define my one
> partial fn if I want.
> (def % partial)
> (map (% + 3) [1 2 3])
>
> That works, and I do prefer it, but I think I'd rather have
> (map %(+ 3) [1 2 3])
>
> This solution feels like a shorthand for #(... %), but it also feels
> familiar because I'm putting the % before for parenthesis.
>
> Unfortunately, I have no idea what the impact of adding another reader
> macro would be, so maybe this is an unrealistic solution. I'd be interested
> to hear feedback.
>
> Cheers, Jay

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