himera
himera copied to clipboard
infinite lazy seqs don't work
Tried this, but it hangs:
(def all-ints (iterate inc 0))
They work, but the problem here is that the REPL attempts to print them. Thank you for the reminder.
Workaround:
(do (def all-ints (iterate inc 0)) nil)
Or:
(defn forget [_] nil))
(forget (def all-ints (iterate inc 0)))
Nice trick. Thanks.
An update to ClojureScript is coming out that will allow this. :def-emits-var true needs to be put in the compiler env. See http://dev.clojure.org/jira/browse/CLJS-934
Cool stuff! CLJS is maturing more and more!