MTS 8: LISP and SLIP in MTS
June 1976
(EQ ’A ’A) = T
(EQ ’(A B) ’(A B)) = NIL
(EQ 8 8) = NIL
(EQNAME A1 A2) Returns T if its arguments are literal atoms
or buffer atoms which have the same PNAME;
otherwise, returns NIL. EQNAME is equivalent
to EQ for normal atoms which are on the OBJECT
LIST. However, for buffer atoms and atoms
created by GENSYM, EQNAME provides a new and
useful function.
(EQNAME ’TEST ’TEST) = T
(EQNAME ’ANINPUTLINE IOARG) = T
if the buffer associated with IOARG has
as its contents "ANINPUTLINE".
(NUMBER A) Returns T if its argument is a numeric atom;
otherwise, returns NIL.
(NUMBER 3) = T
(SORT A1 A2) Returns T if the PNAME of its first argument
is less than or equal to its second argument
in standard EBCDIC collating sequence; other-
wise, returns NIL. A1 and A2 must be literal
atoms or IOARGs.
(SORT ’ABC ’ABB) = NIL
(SORT ’ABB ’ABB) = T
(SORT ’AB ’ABB) = T
(NULL S) NULL is equivalent to NOT.
List-Searching Operations
The functions in this section enable the user to break down LISP
structures into component structures in various ways. The result
will frequently depend on some particular substructure being found.
Examples of these functions follow each description.
(CAR L) Returns the CAR of any structure (i.e., the
first element of any list or the VALUE of an
atom).
(CAR ’((B C) D (E F))) = (B C)
(CDR L) Returns the CDR of any structure (i.e., the
list of remaining elements of any list or
PLIST of a literal atom). An attempt to take
the CDR of a numeric atom will generate a type
0 error.
18 LISP