On Jan 30, 5:44 pm, Daniel Renfer <d...@kronkltd.net> wrote:
> user=> (take 0 (lazy-cat [(println 10)] [(println 20)]))
> 10
> nil
>
> What you see here is not an issue with lazy-cat, but rather an issue
> with take. The current implementation of take evaluates one more than
> the n passed to it.

Hmm, I don't think this is it. For instance,

(take 0 (lazy-cons (prn "asdf") nil))

prints nothing.  (Lazy-cons doesn't need to evaluate things up-front
like lazy-cat, since lazy-cons always returns a (non-empty) seq with
at least one element).

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