MTS 8: LISP and SLIP in MTS
June 1976
((LIST (MAPCAN ’(LAMBDA (A)
(LIST A ’HIT)) X)))))
(STATUS (2 HIT T))
(READ)
(A B C HIT (D E F) G)
will return
(A B C (D HIT E HIT F HIT) G)
and
(READ)
(A B C HIT D E F)
will return
(A B C (D HIT) E F)
PRINTMACRO Atoms
(STATUS (4 HIT T)) defines HIT as a PRINTMACRO atom. Whenever an
attempt is made to print the atom HIT, the HIT function will be
called instead. The value returned from the HIT function is
ignored, since the HIT function itself has complete access to the
current buffer. After return from the HIT function, the rest of
the PRINT operation will be completed.
The READMACRO Character Characteristic
A single-character READMACRO atom may be given the additional
characteristic of a READMACRO character by altering its disposition
in the READ scan table. A READMACRO character need not occur as an
atom, but may occur at the beginning of any S-expression. However,
a READMACRO character which is strictly embedded in an atom, or
which occurs at the end of an atom, will not be recognized as a
macro (unless STATUS was used to alter the system READ tables--see
codes 22-24 in subsection "The STATUS Function").
For example, redefine the character Q as a READMACRO equivalent to
the system ’ substitution function:
(DEFUN Q (X) (LIST (LIST ’QUOTE (READ))))
(STATUS (5 Q 28) (2 Q T))
QA = A
Q(A B C) = (A B C)
QQ(A B C) = (QUOTE (A B C))
52 LISP