Created
September 3, 2012 17:46
-
-
Save gfredericks/3611284 to your computer and use it in GitHub Desktop.
eval-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 eval-let | |
[lettings code] | |
(let [pairs (partition 2 lettings)] | |
`(eval (list `let [~@(apply concat (for [[name val] pairs] [(list 'quote name) val]))] ~code)))) | |
;; (eval-let [a 14 b 48] '(+ a b)) => 62 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment