Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2012 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4355451 to your computer and use it in GitHub Desktop.
Save anonymous/4355451 to your computer and use it in GitHub Desktop.
infinite looping
(defn run-command [simulator command rate]
"Expects a simulator atom"
(loop []
(when-not ((:stopcondition command) command)
(do
(Thread/sleep (/ 1000 rate))
(swap! simulator (command-map command))
(recur)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment