On 8 Aug 2000, Chaim Frenkel wrote:

> >>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
> 
> NI> Chaim Frenkel <[EMAIL PROTECTED]> writes:
> >> Have every Package generate a vtbl for each subroutine in the package.
> >> Then when something is blessed into the package (if this is retained for
> >> OO) then the objects vtbl becomes the precompiled merger of vtbls based
> >> upon the inheritence tree.
> 
> NI> Single inherticance is fairly easy. Multiple inheritance gets messy very 
> NI> quickly and you end up with C++.
> 
> NI> It is far from clear that there is a _necessary_ connection between the 
> NI> OO-in-C we use in the core and the OO-in-perl that language itself 
> NI> has. 
> 
> I wasn't discussing the core. Rather a possible optimization of 
> method lookup.
> 
> At any time only for any method name only a single version can be
> called (at the invocation point) so why not precompile it.

The problem with that is that vtables need to be constant, and the list of
subs in a package isn't constant, nor is it always known at compile time.

I'm all for wedging a pointer to the package symbol table into an object,
and I'm all for pre-hashing the method name into the method call op, and
I'm all for linking the @ISAs (or whatever they end up being) so that a
change to a parent package propagates a weak ref into the child packages
assuming there's no method of that name already. I'm not sure what else we
can do, though.

                                        Dan

Reply via email to