I wouldn't say it has *nothing* to do with dotimes. If dotimes were
lazy rather than eager, then his form would do nothing despite the
eagerness of into, because into is not being called:

(for [i (range 1000000)]
  (into [] (some-expensive-calc)))

On Oct 14, 3:34 pm, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 14.10.2010 um 23:07 schrieb Henk:
>
> > Does dotimes force evaluation?,
>
> At a different level. (dotimes [n 10000] (for ...)) does evaluate the for 
> form. But it returns a seq which is never realised. So you do effectively … 
> nothing. (dotimes [n 10000] (into [] (for ...))) as in your example does 
> consume the sequence and hence realises it. So all the work defined in the 
> for form is actually done. However this is do to into being eager and has 
> nothing to do with dotimes.
>
> Sincerely
> Meikel

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