Created
March 24, 2016 13:39
-
-
Save petterik/dfe3d7de04c3bf770b26 to your computer and use it in GitHub Desktop.
Calling a declared macro results in "wrong number of args (-1)"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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