Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created November 29, 2012 15:48
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 hugoduncan/4169930 to your computer and use it in GitHub Desktop.
Save hugoduncan/4169930 to your computer and use it in GitHub Desktop.
repeated let
(defmacro as
"Binds name to the result of each of the forms. Within each form the previous
binding is available. Returns the final binding."
[name & forms]
`(let [~@(interleave (repeat name) forms)]
~name))
;; (as a
;; 1
;; (+ a 2))
;; => 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment