Mark objects, Null objects, Composite objects – AMT Datasouth PAL User Manual
Page 21: Array objects

Objects
15
that names cannot include the special characters which PAL uses for other purposes. Specifically,
names cannot include any of the following object separator characters.
( ) < > [ ] { } / %
Also, a name cannot satisfy the rules for an integer or fixed-point object. Otherwise, PAL will treat
the name as an integer or fixed-point object. Therefore, PAL accepts "1+" as a name, but "+1" as
an integer object. Likewise, PAL accepts ".1" and "1." as names, but "0.1" and "1.0" as fixed-
point objects.
3.1.6. Mark Objects
A mark object does not have a value. It only has the type mark. Mark objects serve a special pur-
pose under PAL. Several PAL operators manipulate all objects pushed onto the operand stack
above a mark object. PAL has predefined the name mark and has associated the name with a mark
object.
3.1.7.
Null Objects
PAL uses null objects as place holders. For example, when the programmer instructs PAL to create
an array object, PAL fills the array object with null objects. The null objects act as place holders
until the programmer replaces them with other objects.
3.2.
Composite Objects
In addition to simple objects, PAL supports three types of composite objects — arrays, diction-
aries, and procedures.
Composite objects group together collections of other objects. A composite object may contain any
combination of simple objects as well as other composite objects. One composite object may
contain numerous other composite objects, which in turn contain numerous other composite ob-
jects, which in turn contain numerous other composite objects. PAL does not impose any limitation
on the complexity of combinations which the programmer can create.
3.2.1.
Array Objects
Array objects simply contain a list of other objects. Unlike most other programming languages,
array objects may contain any combination of object types. For example, an array might contain a
couple integer objects, four other array objects, six dictionary objects, three string objects, four
name objects, and six procedure objects.
PAL provides three operations for creating array objects. The first operator, array, creates an array
containing all null objects. This allows the programmer to create an array and place the data into it
at a future time. The PAL sequence "24 array" creates an array containing 24 null objects.
The other two PAL operators, "[" and "]," work as a team to create an array containing a desired
collection of objects. The first operator of the pair, "[," starts the array definition. The "[" operator
does nothing more than place a mark object onto the operand stack. In fact, PAL does not care
whether the programmer uses the "[" operator or the predefined name mark to place the mark
object onto the stack. However, using the "[" operator makes PAL sequences much easier for
humans to read.