Combining Proto and Parent Inheritance
variableName
or frame.variableName
to access a slot. Most importantly, notice that frame.
syntax (for example, foo.slotA
) does not use parent inheritance.
An unexpected effect of this scheme of inheritance occurs when you wish to explicitly use the self
variable in lookup. There is a definite difference between accessing a variable using slot
and self.
. As you can see in TABLE 4.2, an explicit use of slot
self.
disables parent inheritance.
This is the case because self.
is just a case of using slot
frame.
. Therefore, you should only use slot
self.
when you are certain you don't want parent inheritance ("Using self in a Method" covers this issue in more detail).
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996