Or perhaps 1.7.0-alpha5 has a change vs. 1.6.0 that makes this code work by accident.
Using lazy sequences to define later elements in terms of the prefix of the sequence up to that point has come up multiple times, usually with the example of generating primes (but different code each time). I don't have time to dig for those examples and the explanation right now, but I believe one potential issue is that lazy sequences are sometimes 'chunked' (the return value of range is) into groups of 32 consecutive elements, and some functions operating on sequences preserve those chunks, and operate on those batches of 32 elements all at once. Also there are some Clojure functions that are 'more eager than necessary', evaluating a few elements of the lazy sequence past the minimum needed. Andy On Thu, Feb 12, 2015 at 12:06 PM, Jorge Marques Pelizzoni < jorge.pelizz...@gmail.com> wrote: > Well, that's a bug then :) And seems to have been fixed. Thanks! > > Em quinta-feira, 12 de fevereiro de 2015 17:51:13 UTC-2, Michael Blume > escreveu: >> >> Oh, well this is fun -- with bleeding edge clojure I get the right >> answer, but with 1.6.0 I see the same results you did. >> >> >> -- > 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. > -- 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.