I only have a brief posting window this morning (I have to leave for
work) so have not researched this as well as I should before coming to
the list - so please forgive if this is a bit lame...

Should I still be using gen-class to achieve link time compatibility
with Java ?

If so, why am I constrained to using a single field to hold my state
(.state) ? (or have I missed something?).

I am finding that all my gen-class-ed types need to define themselves,
as well as a structure for their immutable parts and a structure for
their mutable parts. Every method invocation involves at least two
lookups one to fetch the immutable part from the .state field and one
to lookup some useful piece of data in it.

I'd like to reduce this to one lookup, directly into an immutable
field in the POJO.

Why doesn't gen-class allow e.g. :state [^Integer i ^String s ....] in
a more record like way ? and perhaps a flag to indicate that I want it
to inherit the necessary fn-ality such that I can dereference fields
in it in the same way as in a record ?

It may be that I am using an out of date way of achieving my goals -
I'd appreciate some guidance either way ? I am aware of e.g.
defprotocol and reify but am under the impression that they are for
dynamic typing creation and will not give me link-time compatibility
with the Java code in  my project ?

thanks for your time,

Jules

-- 
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

Reply via email to