MTS 8: LISP and SLIP in MTS
June 1976
Input/Output Operations _______________________
In addition to the powerful FORTRAN I/O facilities, the following
routines are available in the SLIP system.
Instead of generating a list structure by program, a somewhat
cumbersome operation, we can read it in from cards.
The function
RDLSTA(DUMMY)
has a dummy argument, DUMMY, and returns the name of the list or list
structure generated. Lists and sublists are delimited by parentheses;
elements (always in Hollerith format) are separated by a comma or left
parenthesis delineating a sublist. All columns are read up to the
current though arbitrary limit of 72. A list structure can be punched
on several consecutive cards. It starts with an open parenthesis and is
terminated after the last matching closed parenthesis or a terminating
asterisk (*). Blanks can be used freely to improve readability, but
they will be squeezed out of the string read in, even from within
elements. Characters are stored and may be printed in A-format.
If an element is longer than four characters, it is truncated to four
characters. If it is shorter than four characters, it is left justified
and filled with blanks. All blank elements are ignored.
The subroutine
PRLSTS(LST,M)
prints out the datum of every nonname SLIP-cell of a list structure with
alias LST. M can assume three values according to the following table.
M Mode Format _ ____ ______
1 Integer 5X,I14
2 Real F19.8
3 Double Precision D19.8
4 Alphanumeric A8
5 Hexadecimal 3X,Z16
The subroutine prints text lines to mark the beginning and end of the
main list and sublists (empty or nonempty) and a line for each element,
in one of the above formats. Description Lists are not printed.
Recursive list structures must be avoided since no testing in that
regard is included.
For example, if the list structure to be printed M1 is in the string
format
140 SLIP