MTS 8: LISP and SLIP in MTS
Page Revised February 1979 June 1976
For example, when the atomic string "BOOK" first appears in the
input stream, an atomic structure with the PNAME "BOOK" is
automatically created. Any future references to the atom BOOK
reference the same structure. The system OBJECT LIST maintains
pointers to all atomic structures, and each atomic string which
appears in the input stream is checked against this list.
Types of Atoms
There are two types of atoms in LISP: literal atoms and numeric
atoms. When an atom name appears in the input stream, the form of
the name and the current input number base determine the type of
the atom.
If the input number base is 10 (the default case), then FORTRAN-
type integers and single-precision floating-point numbers are
treated as decimal numbers and become numeric atoms. All other
character strings become literal atoms.
If the input number base is 16 (the user may change the number base
by calling the STATUS function), FORTRAN-type floating-point num-
bers are still treated as decimal numbers and become numeric atoms.
However, any character string beginning with a decimal digit (0-9)
and containing only hexadecimal digits (0-9, A-F) are treated as a
hexadecimal number and become a numeric atom with the value of that
hexadecimal number.
If the input number base is 0, then all character strings are
interpreted as literal atom names, and no numeric atoms are
created.
Unlike literal atoms, numeric atoms are not stored on the system
OBJECT LIST; instead, a new atom is created each time a number
appears in the input stream. Thus, two occurrences of the atomic
string "17" produce references to two distinct structures.
VALUE of an Atom
Atoms can have VALUEs, which may be any LISP structure. The VALUE
of a literal atom is undefined (set to the special system atom
*UNDEF*) until a value is given to it. All numeric atoms, by
convention, have themselves as their VALUEs. The VALUE of an atom
is the CAR of the atomic structure (see the discussion of CAR and
CDR below).
Property-Lists
Besides a VALUE, a literal atom can have any number of properties,
and each property has a property-value. For example, the atom BOOK
may have a property COLOR with property-value BLUE, and a property
PAGES with property-value 367. The name of a property is referred
to as the property indicator, or IND, and the property-value is
referred to as the PVAL.
10 LISP

MTS 8: LISP and SLIP in MTS
June 1976 Page Revised February 1979
Associated with each literal atom is a property-list (PLIST) of
indicators and values. If an atom has no properties, then its
PLIST is NIL. Numeric atoms do not have PLISTs. The PLIST of an
atom is the CDR of the atomic structure.
Special Atoms
There are several special atoms in LISP, with predefined VALUEs.
One of these special atoms is NIL, used throughout the system to
indicate a null list, or a truth value of false. The VALUE of NIL
is NIL. The atom T is also a special atom which is used throughout
the system to indicate a truth value of true. The VALUE of T is T.
| An attempt to alter the VALUE or PLIST of NIL or the VALUE or PLIST
of any numeric atom generates a "BAD ATOMIC ARGUMENT" error
message.
The following are the predefined atoms of LISP and their values:
NIL (Program Logic) = NIL
T (Program Logic) = T
LISPIN (Input/Output) = (Input Buffer . SCARDS)
LISPOUT (Input/Output) = (Output Buffer . SPRINT)
ERRIN (Input/Output) = (Error Input Buffer . GUSER)
ERROUT (Input/Output) = (Error Output Buffer . SERCOM)
*ERR* (Error Processing) = (DUMP)
*ATTN* (Error Processing) = (DUMP)
*PGNT* (Error Processing) = (DUMP)
All numeric atoms = themselves
Autoload atoms - see the subsection "Automatic Restoration
| of LISP Functions."
Buffers
LISP supports a data type called BUFFERS. Although buffers are
atoms, they may not be given VALUEs or PLISTs. The PNAME of a
buffer is the current contents of the buffer. Character represen-
tations of LISP structures can be placed in a buffer by calling the
system print functions. New atoms whose PNAMEs are the contents of
a buffer can be created by calling the READ function. All
input/output in the system takes place by printing the contents of
a buffer onto an MTS file or device, and by reading a record from
an MTS file or device into a buffer.
Whenever a buffer is passed as an argument to a function, it is
actually a buffer pointer structure (called an IOARG) which is
passed, rather than the buffer itself. A full description of
buffers is given in the subsection "I/O Data Types."
LISP 11
Previous Page Next Page