Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created March 2, 2016 22:39
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 amalloy/76a82d8f736afcb9ccd8 to your computer and use it in GitHub Desktop.
Save amalloy/76a82d8f736afcb9ccd8 to your computer and use it in GitHub Desktop.
(defmacro let-later [[name val] & body]
(let [delay-sym (gensym (str "delay-" name))]
`(let [~delay-sym (delay ~val)]
(let ~[name (with-meta `(force ~delay-sym)
(meta name))]
(do ~@body)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment