Here is an example:
(defn f1 [] (lazy-seq (cons 0 (f2))))
(defn f2 [] (lazy-seq (cons 1 (f3))))
(defn f3 [] (lazy-seq (cons 2 (f1))))
In Haskell, the equivalent of the above example would produce a lazy sequence of [0, 1, 2, 0, 1, 2, ...], but in clojure this would lead to a CompilerException because f2
could not be resolved.
Is there any way around this?