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

MTS 8: LISP and SLIP in MTS
June 1976
(1,(2,3,(4,())),(5,6,7),8,9,10)
the use of
CALL PRLSTS(M1,1)
produces the following.
BEGIN LIST
1
BEGIN SUBLIST
2
3
BEGIN SUBLIST
4
BEGIN SUBLIST
EMPTY SUBLIST
END SUBLIST
END SUBLIST
END SUBLIST
BEGIN SUBLIST
5
6
7
END SUBLIST
8
9
10
END LIST
TYPES OF SLIP FUNCTIONS _______________________
As noted before, many SLIP quantities and functions should be
declared DOUBLE PRECISION. Several functions have values which are
normally used as integer numbers, so these functions must be declared
INTEGER. Several other functions may be declared DOUBLE PRECISION or
INTEGER and are usually used as integers. These include XMASK, all
partial word functions. Several other functions may be used as integers
but should normally be used as double-precision quantities.
Flags are returned by many routines, including SEQLL, ADVLWR, etc.,
and are returned as integers.
A complete listing of functions and their modes and the modes of
their arguments appears in the subsection "Summary of 360 SLIP Functions
and Subroutines."
SLIP 141
Previous Page Next Page