Dear Clojurians, I have been trying to get a proper grip on the operation of lazy-seq and hope somebody will have the time to clarify a point for me. The references indicate that you should not hold onto the head of a lazy sequence as it blocks the GC. This has lead to me to believe that a lazy sequence, even while being active 'downstream' can be GCd 'upstream'. Is this so ?
An example: in this post http://groups.google.com/group/clojure/browse_thread/thread/57a12f1a0dab5e1b/cb3db6e6ac94092f?#cb3db6e6ac94092f in the first version of fibo, the call (nth (fibo) 1000000) will cause a seq to proceed to the millionth element. If memory were tight could earlier elements be GC'd before nth had reached the end ? My understand is that it can. I ask because on my machine on Clojure 1.2, (nth (fibo) 1000000) causes a heap overflow which I don't understand. Thanks in advance, Edmund -- 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 To unsubscribe, reply using "remove me" as the subject.