[armedbear-devel] Some thoughts on classloaders, ...
Alessio Stalla
alessiostalla at gmail.com
Tue Sep 22 08:42:02 UTC 2009
On Tue, Sep 22, 2009 at 10:28 AM, Don Cohen
<don-sourceforge-xxz at isis.cs3-inc.com> wrote:
> Alessio Stalla writes:
> > The point is that classloaders already work like this! When
> > classloader X loads a class, and that class refers to class C, X is
> > asked by the JVM to load C as well. In abcl we are not using this
> > feature, rather we use an ad-hoc loading model that needs temporary
> > files. I propose to replace that completely and adopt the JVM way.
> Ok, I think I finally understand all you said initially.
> I'm sorry to have put you to so much trouble explaining it.
> I hope a few others will benefit from this explanation.
No problem at all, I myself find this explanation much better than the
first one :D
> > ... However note that your example will probably be
> > compiled by abcl into a call like G.getSymbolFunction().execute(x)
> Ok, that's a reasonable escape hatch.
I believe it works like this, but I haven't the sources at hand to check it.
> > i.e. G will not be resolved to a class at compile time (else how would
> > you handle redefinition?). However, what I'm talking about is (compile
> > 'f (lambda (x) (flet ((g (k) k)) (g x)))) - here g is known at compile
> > time, and compiled to its own class.
> (I understood that. The question above was a new one that arose in my
> mind from what you had been describing.)
>
> > What I propose is this: suppose f is compiled to a class named foo41
> > and g to foo42, then in one of foo41's methods you'll have code like
> > LispObject g = new foo42(). When loading foo41 we'll use our
> > abcl-specific classloader which knows how to resolve foo42 too
> > (because it knows where to read it from memory or from the file
> > system, depending on the type of compilation), and everything
> > magically works (I hope :)
> Sounds plausible but I can see why you say you hope. Good luck.
I say hope because I don't believe in magic :D
> And thanks for your patience.
I have great patience, however I needn't use it to answer your posts;
making things clear for others makes them clearer to me, so it's not a
waste (provided the questions are intelligent, and yours were).
Peace,
A.
More information about the armedbear-devel
mailing list