Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinite lazy seqs don't work #18

Open
ulsa opened this issue Apr 27, 2012 · 5 comments
Open

infinite lazy seqs don't work #18

ulsa opened this issue Apr 27, 2012 · 5 comments

Comments

@ulsa
Copy link

ulsa commented Apr 27, 2012

Tried this, but it hangs:

(def all-ints (iterate inc 0))
@fogus
Copy link
Owner

fogus commented Apr 27, 2012

They work, but the problem here is that the REPL attempts to print them. Thank you for the reminder.

@bernieblume
Copy link

Workaround:

(do (def all-ints (iterate inc 0)) nil)

Or:

(defn forget [_] nil))
(forget (def all-ints (iterate inc 0)))

@ulsa
Copy link
Author

ulsa commented Jun 10, 2012

Nice trick. Thanks.

@mfikes
Copy link
Contributor

mfikes commented Jul 1, 2015

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

@bernieblume
Copy link

Cool stuff! CLJS is maturing more and more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants