Creating Slots
Consider the following, slightly foolish, example. In the first statement, you create a frame
x
with one slot, a
. Next, you assign an integer value of 5 to a slot that is deeply nested within x
:
x := {a: 1};
x.b.c.d.e.f := 5;Perhaps a cascading result is not what you expected, but it is what you get. The second assignment statement actually creates four frames just so it can carry out the assignment. FIGURE 3.2 shows the frames in memory after the code executes.
FIGURE 3.2 : After executing x.b.c.d.e.f := 5
.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996