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