Thanks Justin.  Exploring the options now, at least for the Student class, 
which only has to implement an interface.  Given the requirements of the 
standard ways of using the MASON libs, it initially seemed to me that 
gen-class was my only option.  It's clear now that there are other 
possibilities.  Among other things, I didn't realize that interfaces could 
be used without gen-class.  Sorting out what works, how to make the result 
as efficient as the gen-class version, etc. may take some time.

(I think we really need a book focused solely on Clojure-Java 
interoperability.  It's a big topic, with lots of options, pitfalls, poorly 
documented elements, etc.  I would almost say that about gen-class alone.  
I don't know that there's enough of a market for such a book that anyone 
will bother writing, it, though.)

On Wednesday, May 20, 2015 at 10:24:02 AM UTC-5, Justin Smith wrote:
>
> I'll second the recommendation to use protocols or interfaces to solve 
> this.
>
> Clojure is fairly opinionated in that the tools available should push you 
> toward developing against interfaces or protocols rather than concrete 
> implementations. Things become much simpler when you accept this. You can 
> even have a single file that defines all the protocols you might need, and 
> each of your classes can implement one or more protocols, while defining 
> methods or fields that use other protocols with no circularity needed.
>
> On Tuesday, May 19, 2015 at 8:57:19 AM UTC-7, Mars0i wrote:
>>
>> Gary wrote: 
>>
>> * I was under the impression that Clojure only restricted cyclic 
>> dependencies between ns forms. Have you tried calling 
>> import/require/gen-class directly? 
>>
>> Not much.  I did try one trick that involved switching namespaces inside 
>> a file, but it didn't work. I can try other things.
>
>

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

Reply via email to