method dictionary lookups and walking up the inheritance tree

Andreas Raab andreas.raab at gmx.de
Tue May 16 17:05:05 UTC 2006


Michael Haupt wrote:
>  From ClassBuilder, I could see that, when a new class is created, the
> superclass's method dictionary contents are copied to the method
> dictionary of the new class. Still, the interpreter climbs, in
> Interpreter>>lookupMethodInClass:, up the inheritance tree to resolve
> a method.

Your observation is incorrect. The superclass' method dictionary will 
not be copied. What you see in ClassBuilder is that the method 
dictionary of an "old version" of the class is being copied. This is 
necessary to support class migration, e.g., adding and removing 
variables in a class or one of its superclasses.

Cheers,
   - Andreas




More information about the Vm-dev mailing list