Skip to content

Instantly share code, notes, and snippets.

@tomisme
Created March 5, 2019 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomisme/c8ab7c1222fbb30905b5d30dfbc3d93e to your computer and use it in GitHub Desktop.
Save tomisme/c8ab7c1222fbb30905b5d30dfbc3d93e to your computer and use it in GitHub Desktop.
;; From e.g. https://github.com/scottjad/uteal
(defmacro dlet
"let with inspected bindings"
[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