On Wednesday, March 2, 2011 2:54:07 PM UTC+1, Jules wrote:
[snip]

> I don't have time to look at this any further today, but I think it is 
> looking promising if I can find a way to avoid class name collisions - 
> more hacking of clojure.lang I'm afraid :-( 
>
> Apologies for posting all the source code here - but I thought that it 
> would enable others to follow my track if interested. 
>

I didn't analyze your code in detail but I think you don't have a very clear 
idea of "class name collisions". I'll try to shed some light, in hope of 
helping you; sorry if I'm saying things you already know, or that do not 
apply to your specific case.

In the JVM, classes are not identified by name alone. The identifier of a 
class is a couple (name, classloader), where name is the fully qualified 
name of the class. You can have two classes with the very same name, 
provided that they are loaded by two separate classloaders.
To complicate matters further, classloaders do not exist in isolation but 
form a hierarchy (a tree). They typically work by delegation: each 
classloader first asks its parent, and attempts to load the class itself 
only if the parent can't find it - except for the system classloader, which 
has no parent; and except for classloaders that have been written without 
following the delegation principle (for example, in ABCL we don't use 
delegation within the classloader used to load our compiled functions; we 
used to do that, but the extra trip to the parent classloader with 
consequent ClassNotFoundException had a significant performance impact on 
JRockit).
So depending on the hierarchy, a given classloader might or might not be 
able to load its own version of a class when another classloader has loaded 
a class with the same name.

hth,
Alessio

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

Reply via email to