Meikel, thanks so much for this. I followed your advice<https://github.com/sritchie/carbonite/blob/master/src/jvm/carbonite/JavaBridge.java>and Cascalog and Carbonite are now working Clojures 1.2, 1.3 and 1.4 :)
Cheers, Sam On Wed, Dec 7, 2011 at 8:17 AM, Meikel Brandmeyer (kotarak) <[email protected]>wrote: > Hi, > > I found the easiest approach to be a small wrapper written in Java. > Something like this should work. Not tested, though. > > package carbonite; > > import clojure.lang.RT; > import clojure.lang.Var; > import com.esotericsoftware.kryo.Kryo; > > public class JavaBridge { > static Var require = RT.var("clojure.core", "require"); > static Var symbol = RT.var("clojure.core", "symbol"); > > static Var defaultReg; > static Var regSerializers; > static Var cljPrimitives; > static var cljCollections; > > static { > require.invoke(symbol.invoke("carbonite.api")); > require.invoke(symbol.invoke("carbonite.serializer")); > > defaultReg = RT.var("carbonite.api", "default-registry"); > regSerializers = RT.var("carbonite.api", "register-serializers"); > cljPrimitives = RT.var("carbonite.serializer", > "clojure-primitives"); > cljCollections = RT.var("carbonite.serializer", > "clojure-collections"); > } > > static Kryo defaultRegistry() { > return (Kryo)defaultReg.invoke(); > } > > static void enhanceRegistry(Kryo registry) { > regSerializers.invoke(registry, cljPrimitives.deref()); > regSerializers.invoke(registry, cljCollections.invoke(registry)); > } > } > > Sincerely > Meikel > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Sam Ritchie, Twitter Inc 703.662.1337 @sritchie09 (Too brief? Here's why! http://emailcharter.org) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
