On 23 November 2010 19:01, Ken Wesson <kwess...@gmail.com> wrote: > On Tue, Nov 23, 2010 at 7:49 AM, Laurent PETIT <laurent.pe...@gmail.com> > wrote: >> try >> (def x #(iterate inc 1)) >> (take 1 (drop 1000000000 (x)) >> >> if you do not want to blow up the memory. > > I wonder if an uncached lazy seq variant that cannot hold onto its > head would be useful to have in core?
Such a thing would surely be a very dangerous structure to have around. Clojure's approach is one of immutability and minimal global state, and a non-cached lazy seq would either have to generate the whole sequence up to the last value required every time it was accessed, or it would be creating a nasty implicit side effect in the var, as the seq would need to lose the new value each time it was accessed. R. -- 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