MTS 8: LISP and SLIP in MTS
June 1976
either adds to an existing Description List of the list LST or creates
one and places onto it the attribute-value pair AT and VAL. It does not
check whether the given attribute is already on an existing Description
List. The returned value is the alias of the Description List.
The function
NEWVAL(AT,VAL,LST)
on the other hand, searches the Description List of list LST for the
attribute AT. If the attribute is found, the function assigns the new
VAL to it and returns the old one. Otherwise both AT and VAL are added
to the Description List. If the Description List does not exist, an
empty one is created first. When either AT is not found or there is no
Description List, the value of the function is set to 0. Of course, if
distinction must be made between "no previous attribute AT" or "0
previous value of AT," a corresponding test should precede the use of
NEWVAL. Also, note the difference in the operation and in the returned
values between LDATVL and NEWVAL.
The function
NOATVL(AT,LST)
removes the attribute AT and its associated value from the Description
List of LST. The deleted value is the value returned by the function.
If either LST has no Description List, or the attribute AT is not on it,
the returned value of NOATVAL is 0, and no action is taken. Again, a
distinction must be made between "no previous attribute AT" and "0
previous value of AT."
The function
ITSVAL(AT,LST)
delivers as its value, the value associated with the attribute AT. If
the latter is not found, 0 is returned.
The function
MTDLST(LST)
empties the Description List of list LST if there is one; otherwise, no
action is taken. It returns the alias, LST, of the list.
The function
MADATR(AT,LST)
returns the name of the cell on the Description List that contains the
attribute AT. If the latter is not found, the function delivers -1.
130 SLIP

MTS 8: LISP and SLIP in MTS
June 1976
The above retrieval routines call the subroutine
DERROR(LST)
if they fail to find the required Description List. The routine prints
the name of the Header cell and a warning message.
The Reader Mechanism and the Advance Functions ______________________________________________
The Reader is a one-directional stack, the elements of which refer to
the branch points at which descents were made into sublists.
The following subprograms are useful when working with Readers.
The function
LRDROV(LST)
appoints a Reader for the list with alias LST. It is a single
SLIP-cell. A fatal error message is sent if LST is not a list alias.
The cell name of the Reader is the returned value.
The function
IRARDR(NRD)
does the opposite--it erases the whole Reader stack whose name is, in
integer format, in NRD. The returned value indicates the current depth
of the Reader’s descent into the associated list structure.
The following three routines unpack the information in the top cell
of the Reader stack.
The function
LPNTR(NRD)
returns the name of the cell, CADR, to which the Reader currently
points.
The function
LOFRDR(NRD)
delivers the name of the list to which the Reader is appointed.
Finally, the function
LCNTR(NRD)
SLIP 131
Previous Page Next Page