Created
September 30, 2013 00:19
-
-
Save michaelochurch/6757791 to your computer and use it in GitHub Desktop.
Negative arity reproduction in Clojure macros.
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
user=> (defn foo [x y z w v] 5764) | |
#'user/foo | |
user=> (defmacro bar (foo)) | |
IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:505) | |
user=> (defmacro bar [] (foo)) | |
#'user/bar | |
user=> (defmacro baz [] (foo 1)) | |
#'user/baz | |
user=> (defmacro qux [] (foo 1 2)) | |
#'user/qux | |
user=> (bar) | |
ArityException Wrong number of args (-2) passed to: user$foo clojure.lang.Compiler.macroexpand1 (Compiler.java:6473) | |
user=> (baz) | |
ArityException Wrong number of args (-1) passed to: user$foo clojure.lang.Compiler.macroexpand1 (Compiler.java:6473) | |
user=> (qux) | |
ArityException Wrong number of args (0) passed to: user$foo clojure.lang.Compiler.macroexpand1 (Compiler.java:6473) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment