It seems the below does not compile with 1.8.0 and 1.9.0-alpha14, the same errors appear in both versions.
`
user=> (def fibonacci-1
((fn fib [a b]
(lazy-seq (cons a (fib b (+ a b)))))
0 1))
user=> (filter #(< % 100) fibonacci-1)
ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1501)
user=> (filter #(< % 100) fibonacci-1)
NullPointerException clojure.lang.Numbers.ops (Numbers.java:1013)
user=> (def fibonacci-2
(lazy-cat [0 1] (map + (rest fibonacci-2) fibonacci-2)))
user=> (filter #(< % 100) fibonacci-2)
ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1501)
user=> (filter #(< % 100) fibonacci-2)
(0 1 1 2 3 5 8 13 21 34 55 89)
`
Patch: 0001-CLJ-2069-cache-exceptions-thrown-during-lazy-seq-rea.patch
Proposal: Cache exceptions thrown during lazy-seq realization, to avoid re-running bodyfn which is declared as ^:once
Prescreened by: Alex Miller