Re: suggest to have defn/new/throw/etc.. allow evaluating ...maybe?

2013-02-24 Thread Tim Reinke
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

Re: creating code stubs to use inside an extend-protocol form

2013-02-24 Thread Tim Reinke
Coincidentally, I just found this in clojure/core/protocols.clj (not that this is necessarily the best way to do this): (def arr-impl '(internal-reduce [a-seq f val] (let [arr (.array a-seq)]