Skip to content

Instantly share code, notes, and snippets.

@eraserhd
Created March 8, 2014 19:42
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 eraserhd/9437765 to your computer and use it in GitHub Desktop.
Save eraserhd/9437765 to your computer and use it in GitHub Desktop.
Guess what's wrong?
(defmacro defhandler
[& args]
(let [tags (take-while keyword? args)
[keystroke handler-args & handler-body] (drop-while keyword? args)]
`(def ^{:handles ~keystroke} handler#
(make-handler ~@tags (fn ~handler-args ~@handler-body)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment