
Restrictions
Execution Environment
When you are evaluating code from within the Inspector, the execution environment has some fairly unusual characteristics:
self
is the frame which contains all global variables--the globals frame (the return result of GetGlobals()
).
- Any variables you assign to are created as slots in the globals frame.
Thus, when you are in the Inspector and you execute
x := 1 + 2 + 3 + 4 + 5
you have actually created a slot named x
with the value 15
in the globals frame. This slot will remain until you explicitly remove it (with RemoveSlot(GetGlobals(), 'x)
), or until you reset the Newton.
Caution:
Don't accidentally assign to variables that already exist as global variables. For instance, don't assign to the variable functions
, since that is an existing (very important) slot in the globals frame.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996