> Clojure's laziness is restricted to seqs > and is guaranteed to always produce the same value for the same field. > > Nope: > > => (def foo (int-array [1 2 2 5 9 3])) > #'user/foo > => (def bar (seq foo)) > #'user/bar > => bar > (1 2 2 5 9 3) > => (aset foo 3 3) > 3 > => bar > (1 2 2 3 9 3)
There’s no laziness in that example. With laziness introduced by map, the caching done by lazy seq shows: user> (def foo (int-array [1 2 2 5 9 3])) #'user/foo user> (def baz (map identity foo)) #'user/baz user> baz (1 2 2 5 9 3) user> (aset foo 3 3) 3 user> baz (1 2 2 5 9 3) —Steve -- 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.