Skip to content

Instantly share code, notes, and snippets.

@jneen
Created November 23, 2014 19:42
Show Gist options
  • Save jneen/01122af0f4a04d5e9335 to your computer and use it in GitHub Desktop.
Save jneen/01122af0f4a04d5e9335 to your computer and use it in GitHub Desktop.
(defmacro defvariant
[name [[tag & variant-binders] & other-binders] body]
`(defmethod ~name ~tag [[_# ~@variant-binders]
~@other-binders]
~body)
[name [tag & binders] body]
`(defmethod ~name ~tag [[_# ~@binders]] ~body))
; CompilerException java.lang.RuntimeException: Unable to resolve symbol: & in this context, compiling:(/tmp/form-init8620656005427572977.clj:1:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment