Skip to content

Instantly share code, notes, and snippets.

@llasram
Last active August 29, 2015 13:57
Show Gist options
  • Save llasram/9510281 to your computer and use it in GitHub Desktop.
Save llasram/9510281 to your computer and use it in GitHub Desktop.
(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