(dorun (map f xs ys zs)) creates and discards a cons for each
iteration, no argument there. But its first element is very cheap:
just the result of f, which you had to compute anyway.

(doseq [[x y z] (map vector xs ys zs)] (f x y z)) similarly creates a
cons for each iteration. But its value, rather than being the result
of f, is a vector constructed simply for bookkeeping purposes. Then
before you can call f you must tear apart that vector to get at the
pieces. If performance (either amount of garbage or number of
operations) were the only factor, I can't see any way that this could
be better than the dorun/map approach.

On Jan 23, 6:43 am, "Meikel Brandmeyer (kotarak)" <m...@kotka.de>
wrote:
> And (dorun (map )) is creating a cons with a random value (most likely nil)
> and traverses it and throws it away at every sequence step. YMMV.

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