If you invoke a macro supplying an incorrect number of arguments the arity exception includes the &env and &form special variables in the count (thus making it look like the argument count is 2 greater than that in the code the user wrote).
An example is (while) which indicates
while the same generates the following in Clojure:
A quick experiment shows that it is indeed possible to imitate the solution employed in Clojure (catch the ArityException and re-throw a new one with a decremented argument count). A more generalized approach may be needed to not use Java classes when in bootstrapped.
This ticket is a copy of https://clojure.atlassian.net/browse/CLJ-397#icft=CLJ-397 but for ClojureScript.
If you invoke a macro supplying an incorrect number of arguments the arity exception includes the
&env
and&form
special variables in the count (thus making it look like the argument count is 2 greater than that in the code the user wrote).An example is
(while)
which indicateswhile the same generates the following in Clojure:
A quick experiment shows that it is indeed possible to imitate the solution employed in Clojure (catch the
ArityException
and re-throw a new one with a decremented argument count). A more generalized approach may be needed to not use Java classes when in bootstrapped.