Thanks--you're right, of course, Marshall. (I almost added "without writing it in Java" somewhere in the first part of the post. That doesn't mean writing parts in Java isn't worth considering. I'm just trying to figure out what will and won't work in Clojure itself.)
-Marshall On Wednesday, May 27, 2015 at 1:17:15 PM UTC-5, Marshall Bockrath-Vandegrift wrote: > > Mars0i <mars...@logical.net <javascript:>> writes: > > > I believe these statements are correct, but gen-class is complex and > > deftype use has some nuances, so I want to make sure I haven't missed > > something. > > You have missed one possible approach – write a small integration class > in Java which delegates behavior to a parameterized something more > easily expressed in idiomatic Clojure (e.g., an `IFn` function or > `reify`d interface). > > I’ve made this joke before, but: Java is a pretty solid DSL for writing > Java classes. When you need a Java class which conforms to some > combination of Java-side abstract signatures (extending a base class, > AOTed for discovery by name via reflection, annotations, etc), in my > experience it is frequently/nearly-always easier to adapt from that > interface to Clojure in Java that it is to adapt to that interface from > Clojure in Clojure. > > Some examples: > > > https://github.com/damballa/parkour/blob/master/src/java/parkour/hadoop/Mappers.java > > > https://github.com/damballa/abracad/blob/master/src/java/abracad/avro/ClojureDatumReader.java > > > HTH, > > -- > Marshall Bockrath-Vandegrift <lla...@damballa.com <javascript:>> > Principal Software Engineer, Damballa R&D > > -- 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.