gen-class really isn't suitable for doing complicated interop like annotating fields. It's heavily oriented towards a single means of managing state, which is a single field generally containing an atom, which in turn contains your actual state in a map or similar. If you really need multiple fields you can use deftype/defrecord, but they come with different restrictions - no inheritance, don't require their namespace on class init which is required for many use cases where you might want field annotations. I'm also not sure if their fields can be annotated.
In general when you start needing that level of interop, the easiest thing is just to write a Java class and call into Clojure from there as required. On 14 April 2014 14:28, Jon Seltzer <seltzer1...@gmail.com> wrote: > There are many Java APIs that expect client APIs to annotate fields but > Clojure does not support annotations on fields. Is there any plan to add > support? > > And one tangential question: Is there any consideration of adding > gen-class support for multiple fields instead of just one? > > jbs > > -- > 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 > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.