Hi,

On Jul 20, 12:19 pm, B Smith-Mannschott <bsmith.o...@gmail.com> wrote:

> > Why does (r 2) get evaluated before the seq is needed ?
>
> It doesn't get evaluated before it's needed. As far as the
> implementation is concerned, it is needed before (r 3) is evaluated.

You have to be careful what you mean with "evaluated". (r 2) is
evaluated as would have been for eg. concat. But the lazy sequence is
not realised. The difference is easily seen in (concat (r 2) (r 3))
vs. (lazy-cat (r 2) (r 3)). Still concat and lazy-cat are both lazy
realising the input sequences only as requested.

One could argue, whether for should behave as it does or more like a
(hypothetical) lazy-for.

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