Re: java reflection during macro

2011-12-09 Thread Razvan Rotaru
Thanks. I was missing the call to resolve. (let [klass (resolve c)] ) With it it works. Razvan On Dec 8, 11:39 pm, Stuart Sierra wrote: > Not sure if it helps, but here's my example of using reflection in a macro: > > http://stuartsierra.com/2010/12/16/single-abstract-method-macro > > -S

Re: java reflection during macro

2011-12-08 Thread Stuart Sierra
Not sure if it helps, but here's my example of using reflection in a macro: http://stuartsierra.com/2010/12/16/single-abstract-method-macro -S -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: java reflection during macro

2011-12-08 Thread Kevin Downey
you can use all the things can use outside of macros: resolve Class/forName etc On Thu, Dec 8, 2011 at 1:06 PM, Razvan Rotaru wrote: > Hi, > > I'm trying to write some macros for java object instanciation. Here's > the code: > > > (defn- gen-object-method [my-class id option value] >       (le

java reflection during macro

2011-12-08 Thread Razvan Rotaru
Hi, I'm trying to write some macros for java object instanciation. Here's the code: (defn- gen-object-method [my-class id option value] (let [method (some (java-methods option) (map #(.getName %) (.getMethods my-class)))] (when (not method) (throw (new java.lang.Illega