Clojure's lazy sequences don't promise to support this, but they shouldn't return wrong answers. In the example given in http://groups.google.com/group/clojure/browse_thread/thread/1c342fad8461602d (and repeated below), Clojure should not return bad data. An error message would be good, and even an infinite loop would be more reasonable than the current behavior.

(Similar issue reported here: https://groups.google.com/d/topic/clojure/yD941fIxhyE/discussion)

(def nums (drop 2 (range Long/MAX_VALUE)))

(def primes (cons (first nums)

(lazy-seq (->>

(rest nums)

(remove

(fn [x]

(let [dividors (take-while #(<= (* % %) x)

primes)]

(println (str "primes = " primes))

(some #(= 0 (rem x %)) dividors))))))))

(take 5 primes)

It prints out:

(primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

primes = (2)

2 3 5 7 9)