Skip to content

Instantly share code, notes, and snippets.

@llasram llasram/assoc-keys.clj
Last active Aug 29, 2015

Embed
What would you like to do?
(defmacro assoc-keys
"The inverse of the {:keys [...]} binding form -- assoc the keyword form of
each symbol in syms with the bound value of that symbol."
[map & syms] `(assoc ~map ~@(mapcat (juxt keyword identity) syms)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.