Any chance someone could walk us through how this visibility issue occurs (where the range-based version of primes consumes numbers before they are visible). This really looks like a case where side effects and implementation details are causing what appear to be strange behaviors, based on multiple things that appear to be equivalent (but which clearly are not). I've never gotten things set up yet to be able to debug into clojure internals - maybe this would be a good excuse to do so.
On Oct 11, 6:56 pm, Stuart Halloway <stuart.hallo...@gmail.com> wrote: > When a var's definition has a "lazy reference" to itself, as primes does > below, then your results will be dependent on the lazy/chunky/strict-ness of > the calls leading to the lazy reference. > > The functions range, rest, and remove are chunk-aware, so the range-based > version of primes consumes a bunch of numbers before its changes become > self-visible. Other functions, such as iterate, are not chunked, so the > results are visible to primes sooner. -- 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