Skip to content

Instantly share code, notes, and snippets.

@henryw374
Created May 3, 2018 07:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryw374/5dfcbf9d27ec89b360058e81339cbe4e to your computer and use it in GitHub Desktop.
Save henryw374/5dfcbf9d27ec89b360058e81339cbe4e to your computer and use it in GitHub Desktop.
def all variables in a let expression
;; 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