MTS 8: LISP and SLIP in MTS
June 1976
Input/Output Functions ______________________
(OPEN (IODA BUFFER FILE)...IODA BUFFER FILE))
This function establishes any number of new I/O destination atoms.
IODA must be a literal atom; its VALUE will be set to the new
buffer-file pair which is created. BUFFER must be an integer
between 1 and 255, a previously defined I/O destination atom, or
NIL. If it is an integer, a new buffer will be created with that
initial size. If BUFFER is an I/O destination atom, the buffer
attached to that atom will be used. If it is NIL, then the buffer
portion of the IOARG created will be NIL, and the system input and
output buffers will be used whenever that IOARG is specified in an
I/O call.
FILE must be an atom, a list of a single atom, or a previously
defined I/O destination atom. If it is a non-IODA atom, then that
atom is interpreted as an MTS file or device name. If FILE is a
list of a single atom, then that atom is interpreted as a logical
I/O unit number or name. If FILE is a previously created I/O
destination atom, then the FILE portion of that atom will be used.
This feature allows the user to associate multiple buffers with one
file. If the FILE argument is omitted, then the file portion of
the IOARG will be NIL; when the IOARG is specified in an I/O call,
the system default file will be used.
OPEN is an N-type function which takes its arguments unevaluated.
The value returned from OPEN is NIL.
(EOF IOARG)
This function closes the file associated with IOARG and reassigns
it to *MSOURCE*. An end-of-file on *MSOURCE* will cause a
"CONTINUE?" prompt in conversational mode, and termination of
execution in batch mode.
(READ IOARG IOSW FN)
READ causes the next S-expression in the current buffer to be read
(beginning with the next atom or left parenthesis), and the
corresponding LISP structure to be returned as the value of READ.
If the current buffer is exhausted, a new line is read from the
current file, and the operation continues.
(READCH IOARG IOSW FN)
READCH is similar to READ, except that each character in the buffer
is treated as a separate S-expression, and is returned as a
one-character atom. Commas, parentheses, periods, quotes, blanks,
and other special characters are treated like any other characters,
and simply formed into single-character atoms.
54 LISP

MTS 8: LISP and SLIP in MTS
June 1976
READCH, like READ, automatically reads a new input line if it runs
out of characters. The user may, however, supply an intercept
function (FN) and use RETURN to abort the READCH.
Warning: The user should beware of single-character READ macros
which will be activated by READCH if the character appears, even
incorporated in a character string. This can be suppressed by the
IOSW parameter. Similarly, multiple-character READ macros cannot
be activated by READCH.
(READLINE IOARG IOSW FN)
READLINE causes a new line to be read into the current buffer. The
previous contents of the buffer are destroyed. No LISP structures
are created.
If an intercept form (FN) is supplied, it will always be called
before the line is read.
The value of READLINE is the buffer containing the line that was
read, or NIL, if an end-of-file occurs.
(PRINT S IOARG IOSW FN)
S is the S-expression that is to be printed. PRINT will perform a
TERPRI, print the expression into the current buffer, and will
perform another TERPRI. The value returned from PRINT is S.
(PRIN1 S IOARG IOSW FN)
PRIN1 places the print-name of S in the current buffer, following
any previous contents of the buffer. If the buffer overflows, its
contents are printed on the current file, and the operation
continues. The arguments of PRIN1 have the same meaning as those
of PRINT.
(TERPRI IOARG IOSW FN)
TERPRI causes the contents (if any) of the current buffer to be
printed in the current file. If the buffer is empty, TERPRI does
nothing. The value of TERPRI is NIL.
If an intercept function (FN) is supplied, it will be called
whenever the buffer is printed.
(TAB N IOARG FILL)
TAB causes a tab operation to position N in the current buffer.
(The first position in a buffer is 1; thus (TAB 1) will clear a
buffer without printing it.) If the buffer has a prefix, TAB
operates relative to the prefix. If N is nonpositive, or larger
than the buffer size, an error is generated.
LISP 55
Previous Page Next Page