Combining Proto and Parent Inheritance

Testing for the Existence of Slots

There are also a number of different ways to test whether a slot exists. TABLE 4.3 summarizes these methods.
Different ways to test for the existence of slots.
SyntaxExampleUses Proto InheritanceUses Parent Inheritance
slot existsslotA existsXX
frame.slot existsself.slotA existsX 
frame.(pathExpr) existsself.('slotA) existsX 
frame:slot existsself:MethodA existsXX
HasVariable(frame, symbol)HasVariable(self, 'slotA)XX
HasSlot(frame, symbol)HasSlot(self, 'slotA)  


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996