-
-
Save shayanjm/d37b5b34b08281fa0aa7 to your computer and use it in GitHub Desktop.
This file contains 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
(defn infinite-loop-on-realization | |
"Given a function, loop that function on realization indefinitely." | |
[func] | |
(let [current-exec (future (func))] | |
(when (realized? current-exec) | |
(infinite-loop-on-realization func)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment