MTS 8: LISP and SLIP in MTS
June 1976
(APPLY1 FN S1...SN) Causes the function FN to be invoked, where
S1...SN are the arguments of FN. FN may be
any LISP function specification.
(APPLY1 ’CAR ’(A B C)) = A
(APPLY1 ’CONS ’X ’Y) = (X.Y)
(MAP FN L1...LN) Causes the function FN to be called, with
L1...LN as its arguments, and then again with
(CDR L1)...(CDR LN) as its arguments, and then
to be called again with (CDDR L1)...(CDDR LN)
as its arguments, etc., until the shortest
list is exhausted. Thus, when MAP is used,
the arguments of FN will always be lists,
never atoms.
MAP returns NIL.
(MAPC FN L1...LN) Works like MAP except the CAR of each succes-
sive list is used as the argument to FN.
Thus, MAPC calls FN with (CAR L1)...(CAR LN)
as its arguments, and then with (CADR L1)...
(CADR LN), etc.
MAPC returns NIL.
(MAPLIST FN L1...LN) Causes the function FN to be called with
L1...LN as its arguments, and then with (CDR
L1)...(CDR LN), etc., just as in MAP. How-
ever, the value returned from MAPLIST is the
list of all the successive values returned
from FN.
(MAPCAR FN L1...LN) Works like MAPLIST except the CAR of each
successive list is used as the argument to FN.
MAPCAR returns a list of all the successive
values returned from FN.
(MAPCON FN L1...LN) Causes the function FN to be called with
L1...LN as its arguments, and then with (CDR
L1)...(CDR LN), just as in MAP. However, the
value returned from MAPCON is a concatenated
list of all the values returned from FN.
(MAPCAN FN L1...LN) Works like MAPCON except the CAR of each
successive list is used as the argument to FN.
MAPCAN returns a concatenated list of all the
values returned from FN.
Note: The user should be aware that the
values returned from FN, when called via
MAPCON or MAPCAN, must be lists, or an error
will result.
28 LISP