MTS 8: LISP and SLIP in MTS
June 1976
yields the depth to which the Reader has descended into the associated
list structure.
Other routines include the function
REED(NRD)
which returns as value the contents of the SLIP-cell to which the Reader
NRD points. It can be considered a null advance function compared to
the following three routines.
The function
LVLRVT(NRD)
causes the Reader NRD to ascend back to the main list from any current
position in a list structure. After the execution of this routine, the
Reader points to that SLIP-cell on the main list from which the descent
originated. If the Reader initially points to a main-list element no
action is taken. When LVLRVT is used as a function the returned value
is that of the argument. Thus, LVLRVT can be nested within another
function that also requires the NRD argument.
The function
LVLRV1(NRD)
has a similar role, but it makes the Reader ascend only one level.
Again, no action is taken if the Reader initially points to the main
list.
The function
INITRD(NRD)
goes linearly along the list it is currently pointing to until it hits
the Header cell.
A Reader can be initialized from any state by
IDUM=INITRD(LVLRVT(NRD))
Here LVLRVT brings the Reader to the "surface" (i.e., to the main list),
and INITRD makes it point to the Header of that list.
There is no theoretical limitation concerning the number of Readers
appointed to and traversing concurrently the same list structure. A
copy of the Reader can be made by using the function
LRDRCP(NRD)
The name of the new Reader is delivered as its value.
132 SLIP