
Fundamentals of NewtonScript
Frames
{slotname: value, slotname2: value, ...}
This data structure is the elastic construct that binds all NewtonScript programs together. Here is a basic definition of a frame:
- A frame is a dynamic, unordered collection of named values.
- Each element in a frame is called a slot and is composed of two things--a name and a value.
- A slot can hold any type of value, including another frame. Thus, frames can be (and often are) deeply nested structures.
- Frame syntax uses { }, frame elements are separated by commas, and the slot name is followed by a colon.
Frames are somewhat similar to a C struct or Pascal record. They are different in that they are truly dynamic--slots can be added or removed at any time.
- Creating Frames
-
- Frames within Frames
-
- Accessing Slots
-
- Creating Slots
-
- Removing Slots
-
- Slot Existence
-
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996