MTS 8: LISP and SLIP in MTS
June 1976
however, include C, (D E), and all of its sublists, as well as all
the sublists of the top-level list.
NIL
The list of zero elements ( ) is equivalent to the atom NIL within
the LISP system. Thus, the CDR of (A) is ( ), or NIL. The result
of this dual interpretation is that NIL is treated as an atom for
most purposes, and as a list for some other purposes. For example,
the CONC function which accepts only list arguments, and the COPY
function, whose argument may be a list or an atom, both treat NIL
as the null list ( ).
The LISP Interpreter ____________________
LISP is an interpretive language. The system reads one S-expression,
or form, from its input stream, evaluates it, and prints out the value
computed, then reads another S-expression, etc. Since the top-level
controller calls READ to get an S-expression, EVAL to evaluate it, and
PRINT to print out the result, the top level function of LISP is often
referred to as a READ-EVAL-PRINT loop.
Input to LISP
Input to LISP is free format, with blanks, commas, periods,
parentheses, angle brackets ( and ), and ends-of-line acting as
separators. Any time a separator appears, it may be surrounded by
any number of blanks. Extra right parentheses may be inserted at
the beginning or the end of a top-level form; they are ignored.
For example:
)) (A B C D)))) = (A B C D)
If a semicolon (;) appears anywhere in an input line, the system
ignores the remainder of the line, and skips to the next line.
Thus, the semicolon is equivalent to an end-of-line. This allows
the user to put comments in his input file without the expense of
making an atom from every word.
Warning: The semicolon is an MTS carriage-control character which
causes a line printer to skip to a new page if it is the first
character in an output line.
Note: An exception is made to the treatment of the period as a
separator when it occurs in a legal floating-point number. In that
case, the period is interpreted as part of the number. To make a
dotted pair of two numbers, the period must be surrounded by
blanks. For example, (123.456) is a list of a single numeric atom,
while (123 . 456) is a dotted pair of two integers.
14 LISP