Avital Oliver <avi...@thewe.net> writes:

> My experience is that you should only use filter/map if you either have a
> pre-existing function or you want to use a _very_ short closure (using #()).
> For any other case the code becomes unmanageable and then I feel that using 
> for
> is the wiser choice.

I agree, but then again I've been criticized for writing "too bulky"
functions so perhaps it's better to extract the conditions and the body
as separate functions where possible. I guess the other advantage of map
is that is more easily replaced with 'pmap'.

> I hope that they are just as efficient, but I haven't really tested it. I feel
> like even if it isn't right now they can be brought up to the same speed.

In theory 'for' is slightly more efficient than a filter/map combo as it
avoids one lazy sequence, but for almost all purposes the difference is
negligible and not worth bothering over.

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