Frames
frame.slot exists
exists
operator. Given this frame:
x := {a: 1, b: 2};you might use
exists
in this manner:
ifor:x.a exists then Print("a is a slot in x");
doesFooExist :=You can also determine slot existence in other ways. The methods vary, however, in how they deal with inheritance (for a discussion of the alternatives, see "Using self in a Method" on page 100).x.foo exists ; if doesFooExist then Print("uh-oh, foo shouldn't be a slot in x");
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996