Created
May 3, 2018 07:24
-
-
Save henryw374/5dfcbf9d27ec89b360058e81339cbe4e to your computer and use it in GitHub Desktop.
def all variables in a let expression
This file contains hidden or 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
;; handy when working at repl. something in a let statement is not working and so you want to def the variables so you can try | |
bits one by one | |
(defmacro deflet [bindings & body] | |
`(let ~bindings | |
~@(for [v (map first (partition 2 (destructure bindings)))] | |
(list 'def v v)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment