I'd prefer the for-version in this case.

You see the differences if you try `for` and `map` with multiple collections.
`for` is a traditional list-comprehension (1).
`map` iterates over many sequences at once, `for` does "nested" iteration.

(1): http://en.wikipedia.org/wiki/List_comprehension#Clojure

On Mon, Jun 28, 2010 at 8:48 PM, Oleg <oleg.richa...@gmail.com> wrote:
> I will show example based on hiccup library:
>
> For version: [:ol (for [x coll] [:li x])]
> Map version: [:ol (map (fn [x] [:li x]) coll)]
>
> What's the difference between them? What is better for performance?
>
> Cheers, Oleg
>
> --
> 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



-- 
Moritz Ulrich
Programmer, Student, Almost normal Guy

http://www.google.com/profiles/ulrich.moritz

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