Skip to content

Instantly share code, notes, and snippets.

@petterik
Created March 24, 2016 13:39
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 petterik/dfe3d7de04c3bf770b26 to your computer and use it in GitHub Desktop.
Save petterik/dfe3d7de04c3bf770b26 to your computer and use it in GitHub Desktop.
Calling a declared macro results in "wrong number of args (-1)"
(declare fail)
(defn fail* [m]
(if (map? m)
(fail 1)
m))
(defmacro fail [m]
(if (map? m)
(fail* m)
m))
(fail* {:a 1}) ;; => Wrong number of args (1) passed to: fail
(fail {:a 1}) ;; => Wrong number of args (-1) passed to: fail
(fail 1) ;; => 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment