Created
November 29, 2012 15:48
-
-
Save hugoduncan/4169930 to your computer and use it in GitHub Desktop.
repeated let
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
(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