MTS 8: LISP and SLIP in MTS
June 1976
Specifically, an IOARG (the VALUE of an I/O destination atom) is a
dotted pair (BUFFER . FILE), which may be used to direct input/
output operations, and may also be used as a buffer pointer for
performing operations on buffers, e.g., EXPLODE, etc. If either
component of an IOARG is NIL, then the appropriate system buffer or
file is used. The VALUE of the I/O destination atom LISPIN is the
dotted pair of the default system input buffer and system input
file. The VALUE of the I/O destination atom LISPOUT is the dotted
pair of the default system output buffer and system output file.
If the user changes the system default buffers or files using the
STATUS function (the equivalent of a read- or write-select opera-
tion), he may still have access to the original system IOARGs
through LISPIN and LISPOUT.
Buffers
A buffer is an atomic structure with a variable PNAME, which is
accessed through one or more IOARGs. New buffers may be created
and linked to I/O destination atoms by calling the OPEN routine.
Buffers are used for input/output, and may also be viewed as
character strings.
The maximum size of a buffer is 255 characters.
Any PRINT operation into a buffer will cause a representation of
the argument to be placed in the buffer. Any READ operation from a
buffer will create and return the LISP structure represented by the
next S-expression in the buffer.
Instead of the buffer itself, the IOARG whose CAR is the buffer is
always passed as an argument to a function. For example, functions
such as EXPLODE, which forms a list of one-character atoms from the
characters in a buffer, or GENSYM, which creates an atom whose
PNAME begins with the current contents of the buffer, expect an
IOARG to be passed rather than the buffer itself. The FILE portion
of the IOARG is ignored. Thus, the IOARG also serves as a buffer
pointer throughout the system. However, when functions such as
READLINE, TAB, and SKIP return buffer pointers, it is the actual
buffer structure and not the IOARG which is returned.
The atomic structure of a buffer extends only to its PNAME.
Buffers may not be given VALUEs and PLISTs by the user. However, a
buffer may be part (or all) of the list-structure argument to a
PRINT or PRIN1. For printing purposes, a buffer is treated like
any other literal atom, and its PNAME is inserted into the output
buffer.
For example, if (PRIN1 (CAR LISPIN) BUF1) appears as an input line
under normal conditions of operation, the character string " (PRIN1
(CAR LISPIN) BUF1)" is placed in the buffer associated with I/O
destination atom BUF1.
48 LISP