MTS 8: LISP and SLIP in MTS
June 1976
Data types more complex than simple lists are also needed. A list
structure consists of a main list and a hierarchy of sublists. The
elements on the main list, and also on its sublists, are either data or
names of sublists. In the cases of self-referencing by a list or
cross-referencing between two lists, special care must be taken, of
course, to avoid an infinite loop in processing.
Rings and ring structures are analogous to lists and list structures,
respectively. However, in rings and ring structures a link connects the
last and first cells. This is why the term circular list is also used.
The first cell of every ring must be marked; otherwise, the processing
of elements would again go on indefinitely. The information structures
in SLIP are of this type. Distinction can be made as to whether one- or
two-directional pointers connect neighboring elements. The latter
arrangement, also used by SLIP, offers certain processing advantages at
the price of an extra link field in every node.
Data representations present problems of external (user’s) and
internal (inside the computer) representation. The solution to the
problems of external representation is, of course, idiosyncratic to the
language and will not be discussed here. Higher-level and more recent
languages tend to be more convenient for the user.
Depending on the amount of information stored in each cell and on the
word length of the machine on which the list processing language is
implemented one, two, or sometimes a higher varying number of computer
words are used for a cell. The lists need not contain the actual
information but may contain only links that point to a centralized data
table. The referencing to data can be direct or manifold indirect
(pointer to pointer to ... pointer to data). If a list contains data
of different modes, special markers are needed to indicate the type of
information in each cell.
Description Lists contribute to the power of SLIP. These lists
consist of a sequence of attribute-value pairs and can provide further
information about lists. Suppose, for example, a list structure
describes the current position on a chessboard. It has 64 sublists, one
for each square. Each sublist has a Description List with attributes:
occupancy status (the possible values are the 32 men and "empty"), your
own men defending the square (the value is a list of men, possibly
empty), opponent’s men attacking the square (the value is as before),
etc. As we can see, in general the value can be symbolic or numeric, a
single unit of data or a list of data. Also, a Description List itself
can have a Description List and so on.
If a list or list structure is copied or erased (i.e., returned to
Available Space List), its Description Lists undergo the same treatment.
An elegant and often very important list-processing technique
involves the use of recursive computations. A recursive subroutine is
one that calls itself. The input parameters of the subroutine called
later normally depend on the intermediate results of the same subroutine
114 SLIP