Skip to content

Instantly share code, notes, and snippets.

@akkartik
Created May 6, 2019 04:18
Show Gist options
  • Save akkartik/2c87e819ce7a73704fcdbfcd49db7f13 to your computer and use it in GitHub Desktop.
Save akkartik/2c87e819ce7a73704fcdbfcd49db7f13 to your computer and use it in GitHub Desktop.
(mac every (n . body)
`(thread
(while t
(sleep ,n)
,@body)))
;; try it out
; print a heartbeat every second
(every 1 (prn "."))
; fizzbuzz
(every 3 (prn "fizz"))
(every 5 (prn "buzz"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment