Thank you very much Tim. I will use the eval one with thrown?
On Mon, Feb 25, 2013 at 6:49 AM, Tim Reinke t...@mostcallmetim.com wrote:
It's nice to see some input validation!
It seems your problem, ultimately, is the testability of macros.
You can wrap the call to the macro in an eval
It's nice to see some input validation!
It seems your problem, ultimately, is the testability of macros.
You can wrap the call to the macro in an eval (this way the error is thrown
by eval, not the compiler):
(is (thrown? AssertionError (eval '(dedefn (str a b)
This can get a little
= *(defn (symbol (str a b)) [x] x)*
IllegalArgumentException First argument to defn must be a symbol
clojure.core/defn (core.clj:277)
maybe allow ~ like this:
=* (defn ~(symbol (str a b)) [x] x)*
IllegalArgumentException First argument to defn must be a symbol
clojure.core/defn (core.clj:277)
to