If you want to maintain backwards compatibility with 1.1, there are a few gotchas:
* don't use 1.2-specific features like deftype, obviously. * don't aot-compile anything. If you need gen-class *and* 1.1, you can clearly document which nses need it and require your users to perform the compilation once they've decided on a clojure version. * reduce your use of contrib. If you stick with libs that haven't changed you'll be OK, but odds are you're going to want duck streams/io, etc. You can spin off just the nses you need in a way that will work with any version; see http://clojars.org/clj-io for an example. * you can also surround your contrib requires with try/catch. This gets tedious if there are many. Hope that helps. This is a relatively new problem for clojure, so the issues haven't been totally figured out yet. - Phil On Apr 18, 2010 6:22 AM, "Heinz N. Gies" <[email protected]> wrote: Hi I'm not certain how to approach this problem the best, since libraries are compiled class files they are statically linked to the clojure and c.c version they were compiled with. Please correct me if I'm wrong. Now also between 1.1 and 1.2 some namespaces changed entirely so some code had to be version dependent for sure. So I wonder how to handle this, for applications it isn't that much of an issue since the app can depend on one specific clojure version but for libraries this is a real challenge. The obvious approach would be to maintain one copy of the library for every clojure release out in the wild. So for the moment it'd be 1.0 1.1 and 1.2, meaning a lib developer had to maintain 3 branches or whatever of the library, compile 3 jars and push them to clojars. While this is possible it is a sad solution is there any way to compile a jar that works with all versions of clojure? Even if it is like (:use my.lib.1-2) or something like that I think it'd be better then keeping dozens (I know it are only 3 at the moment) of copies. So have any of the smarter people thought about this already or is this a open issue? Regards, Heinz -- 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]<clojure%[email protected]> 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 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
