Created
October 11, 2016 22:46
-
-
Save x/bf1c529daa0c0c3f1a0a68054ffce05d to your computer and use it in GitHub Desktop.
lazy seq that prints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def my-lazy-seq | |
(let [i (volatile! 0)] | |
(repeatedly | |
#(let [j (vswap! i inc)] | |
(println j) | |
j)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment