MTS 8: LISP and SLIP in MTS
June 1976
TOP(LST)
and
BOT(LST)
deliver the datum of the top and bottom cells, respectively, of the list
with alias LST without changing the list. The programmer should first
test whether the list is empty. If it is, the returned value is the
contents of the datum word of the Header, essentially garbage.
The equivalent functions, that also destroy the cell involved, are
POPTOP(LST)
and
POPBOT(LST)
In case LST refers to an empty list, 0 is returned and a warning message
is given.
More general retrieval routines, affecting the inner part of lists,
are discussed in connection with the Reader mechanism (see the subsec-
tion "The Reader Mechanism and Advance Functions").
Retrieving Data from SLIP-Cells _______________________________
The twin functions
DATUM(CADR)
or
DATUM(MADR)
and
IDATUM(CADR)
or
IDATUM(MADR)
have similar roles; they return the contents of the datum part of the
cell whose name is in CADR or MADR. Again the duplication is provided
to overcome the FORTRAN mode-conversions in unwanted cases. Specifical-
ly DATUM returns the full double word contents of the datum in DOUBLE
PRECISION mode while IDATUM returns only the first word of the datum in
INTEGER format. Should that first word be wanted in REAL format then
one can employ
124 SLIP

MTS 8: LISP and SLIP in MTS
June 1976
REALS(DATUM(CADR))
Note that
IDATUM(CADR)
is equivalent to
INTGER(DATUM(CADR))
More Routines Concerning List Cells ___________________________________
The following two functions split lists in two.
NULSTR(CADR, LST)
and
NULSTL(CADR, LST)
create new lists. The new list is formed of a block of cells taken from
the original list with alias LST. The block consists of the cell with
name CADR and all cells to its right or left, respectively. These cells
are, of course, removed from the original list. The schematic diagram
in Figure 1 makes these operations clear. The returned value of the
functions is the name of the new list.
SLIP 125
Previous Page Next Page