I really fail to see how this can be related to chunking. So in:

(def primes (cons 2 (lazy-seq (filter #(prime? primes %) (drop 3 
(range))))))

*prime?* would be being called with unbound *primes*? And no exception 
would be raised and again no 4 or even numbers left to testify?

Em sexta-feira, 13 de fevereiro de 2015 01:38:19 UTC-2, Justin Smith 
escreveu:
>
> Clojure is quite elegant, but it's not always unsurprising.
>
> Even if one surprising behavior around lazy-seq realization is changed, 
> others are likely to continue to occur.
>
> The solution to this is to not write code that implicitly relies on a 
> specific timing of lazy realization. If you need results to be calculated 
> in a certain scope, force them, and if you need results to be maximally 
> lazy in order to have correct code, then either force results not to chunk 
> (there are code examples for a "dechunk" function on the net) or refactor 
> to a form that doesn't rely on maximal laziness for correctness. As far as 
> I know, chunked sequences are not likely to leave the language any time 
> soon, and the behavior we see here will inevitably happen with chunked 
> inputs.
>
>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to