At 10:01 AM 8/9/00 -0400, Chaim Frenkel wrote:
> >>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
>
>NI> So having the object carry around a (pointer to a) table to methods
>NI> has merit. But how to index that table? Computing the union of all
>possible
>NI> method names for all possible classes and assiging each a slot in the
>table
>NI> will yield a very large table which for any particular class will be
>sparse.
>NI> Hence perl5's use of class's "stash" hash has where to store it.
>
>
>For the "my Dog $spot" case, that's not an issue, compile time resolution.
Nope. Because "$spot = new Keeshound;" is valid.
>But for the generic object. The package itself can contain an indirection
>table. This would be that sparse table with the offset in the object vtbl.
That's going to be a very sparse table, though. It needs to have as many
entries as there are sub names, be able to grow as new subs are defined,
and have to be duplicated for each package.
I can see that getting very big.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk