Stuart Sierra <m...@stuartsierra.com> writes:
> On Tue, May 14, 2013 at 3:25 AM, Phil Hagelberg <p...@hagelb.org> wrote:
>
>> It's really not difficult to do if you limit yourself to Clojure since
>> Clojure namespaces are first-class and easy to manipulate at
>> run-time. We implemneted a prototype of this in under two hours at a
>> Seajure meeting a while back:
>>
>>     https://github.com/technomancy/metaverse
>>
>> However, it's significantly more difficult to do for arbitrary Java
>> bytecode.
>>
>
>
> That's cool, and it will work for the simple case of libraries A and B
> depending on different versions of C.
>
> But it still breaks down in more complex cases: e.g. if I want to share
> data between A and B using a protocol or type defined in C, and there are 2
> incompatible versions of C. Even ClassLoaders can't help you there - I'm
> not aware of any solution.


Automatically, no, but the solution would be to use something akin to an
adaptor. The two versions of C would be manipulated to be in different
namespaces; now you just have two libraries, so the task of plumbing
them together remains the same. 

To be honest, though, this is unlikely; after all, if you are using A
and B, and they are using C *as a utility*, my feeling is that C
shouldn't really be in their public interface. If C *is* in their public
interface, then again, you need adaptors.

Or you can fork A and/or B, fix them to use the same version!

Phil

-- 
-- 
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/groups/opt_out.


Reply via email to