Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created June 17, 2015 16:35
Show Gist options
  • Save jhsu/10920792785a4b7519f4 to your computer and use it in GitHub Desktop.
Save jhsu/10920792785a4b7519f4 to your computer and use it in GitHub Desktop.
print out values of a let statement. taken from: http://blog.gaz-jones.com/2012/02/04/debug_let.html
(defmacro dlet [bindings & body]
`(let [~@(mapcat (fn [[n v]]
(if (or (vector? n) (map? n))
[n v]
[n v '_ `(println (name '~n) ":" ~v)]))
(partition 2 bindings))]
~@body))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment