Chaim Frenkel <[EMAIL PROTECTED]> writes:
>>>>>> "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.

Okay - so thread has drifted.

>
>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 methods is that which method is called depends on the
_object_ not the invocation point. 

So having the object carry around a (pointer to a) table to methods  
has merit. But how to index that table? Computing the union of all possible
method names for all possible classes and assiging each a slot in the table
will yield a very large table which for any particular class will be sparse.
Hence perl5's use of class's "stash" hash has where to store it.

>
><chaim>
-- 
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.

Reply via email to