MTS 8: LISP and SLIP in MTS
June 1976
return the cell name of the Nth cell from the top and bottom,
respectively. If fewer than N cells are on the list, the counting is
circular. The Header is included in the count, but the first cell (N =
1) from the top is the top cell. Therefore, if the list contains M
cells, including the Header, we can obtain the cell name of the first
cell by writing either
MADHD = MADNTP(LST, M + 1)
or
MADHD = MADNBT(LST,M+1)
The datum, say an integer, can be retrieved from the Ith cell by
INT = INTGER(DATUM(MADNTP(LST,I)))
or
INT = IDATUM(MADNTP(LST,I))
HOW TO MAKE COMMENTS ON LISTS _____________________________
List Marks and Description Lists ________________________________
It is often necessary to attach additional information to lists. If
this information is restricted to designating four different classes of
lists, list marks are used. More extensive comments require Description
Lists.
The function
MRKLST(N,LST)
places the integer N(=0,1,2, or 3) as a List Mark for the list with
alias LST. The returned value of the function is the list name (in list
name format).
The function
MRKLSS(N,LST)
performs the same operation for a whole list structure. The returned
value is the list name (in list name format).
The function
LSTMRK(LST)
128 SLIP

MTS 8: LISP and SLIP in MTS
June 1976
delivers as its value the List Mark found in the Header cell of the list
with alias LST.
The processing of a complex list structure with interwoven auto- and
cross-referencing is greatly enhanced by the List Mark facility.
Description Lists are "associated" with the corresponding lists, as
opposed to the "subordination" of sublists. However, a particular list
can be both a Description List and a sublist of several lists--if it
makes sense. This close relation betweeen a list and its Description
List also means that erasing a list automatically erases its Description
List as well.
To erase the Description List only, we can use
IDUM=IRALST(NAMEDL(LST))
where the function
NAMEDL(LST)
delivers as its value the alias of the Description List associated with
list LST.
Each Description List contains an even number of SLIP-cells, repre-
senting attribute-value pairs. An attribute can be any type of _________
characteristic of the list, in a format determined by the programmer.
The value of the attribute occupies the second cell and can be a number, _____
characters, or even the alias of a value list.
Several subprograms facilitate the use of Description Lists.
The function
LISTAV(LST)
creates an empty Description List for the list with alias LST. If a
Description List already exists for this list, it is not erased but is
replaced with the new empty Description List. The function returns as
its value the alias of the new Description List.
The function
MAKEDL(LST1,LST2)
causes the list with alias LST1 to become the Description List of list
LST2. If the latter already has a Description List, it is first erased.
The function returns the value LST2.
The function
LDATVL(AT,VAL,LST)
SLIP 129
Previous Page Next Page