... so the main problem seems to be chunked vs. unchunked sequences in 
corecursion.
I read a bit into "chunked sequences" and so far it seems that a sequence 
is either chunked with size 32 or unchunked. So a "rechunk" of variable 
size seems of no use. Instead I found an "unchunk" at stackoverflow:

(def unchunk #(lazy-seq(when(seq%)(cons(first%)(unchunk(rest%))))))

Now the original code posted at top also works with "(drop 2 
(unchunk(range)))".
Further I found following remark by RichHickey in changes.txt for Clojure 
1.1 
(https://github.com/richhickey/clojure/blob/68aa96d832703f98f80b18cecc877e3b93bc5d26/changes.txt#L85)

Consumption of chunked-seqs as normal seqs should be completely transparent. 
However,  
note that some sequence processing will occur up to 32 elements at a time. This 
could  
matter to you if you are relying on full laziness to preclude the generation of 
any  
non-consumed results. An interface to force single-item consumption of chunked 
seqs is  
still being designed. Please share any use cases where chunked processing has 
resulted  
in behavioral differences that matter to you on the Clojure google group. 

Now, this is a good such example, where chunking leads to behavioral error. 
Has the afore mentioned interface for forced single-item consumption 
meanwhile been created?

Ulrich

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