defmacro/gen-class/annotation woes

2013-02-27 Thread Michael Willis
Hi Folks, I'm attempting to write a clojure macro that uses gen-class to replace several manually written Java classes that all follow a similar pattern. Yes, in my magic world of unicorns and mermaids, I would just rewrite them in pure clojure, but for the context of this question my solution

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Meikel Brandmeyer (kotarak)
Hi, just a wild guess: quote the annotation in the macro. (with-meta name `{Deprecated true}). Note the backtick. Kind regards Meikel -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Paul Richardson
Meikel, Good guess - your idea works! I'm impressed. What made you think of that? How did you know to syntax-quote the metadata map? I'm curious how you solved it. Paul On Wednesday, February 27, 2013 11:52:05 PM UTC-7, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > just a wild guess: quote

Re: defmacro/gen-class/annotation woes

2013-02-27 Thread Meikel Brandmeyer
Hi, if you want to avoid reflection in macro-generated code you have to quote the class because the compiler expects the classname and not the class itself. I figured it could be similar here. Kind regards Meikel -- -- You received this message because you are subscribed to the Google Groups "

Re: defmacro/gen-class/annotation woes

2013-02-28 Thread Michael Willis
Hi Meikel! Thanks for the suggestion. I'll second what Paul said, I'm not sure if I would ever have guessed to syntax quote the metadata map. I just tested it and it works like magic. Cheers, Michael Willis On Thursday, February 28, 2013 12:21:57 AM UTC-7, Meikel Brandmeyer (kotarak) wrote: