List Functions
Lists
Lists as Sets
These functions substitute elements throughout a tree of cons
cells. (See Sequence Functions, for the substitute
function, which works on just the top-level elements of a list.)
&key :test :test-not :key
car
s and cdr
s
of the component cons cells. If old is itself a cons cell,
then matching cells in the tree are substituted as usual without
recursively substituting in that cell. Comparisons with old
are done according to the specified test (eql
by default).
The :key
function is applied to the elements of the tree
but not to old.
&key :test :test-not :key
subst
, except that it works by
destructive modification (by setcar
or setcdr
)
rather than copying.
The subst-if
, subst-if-not
, nsubst-if
, and
nsubst-if-not
functions are defined similarly.
&key :test :test-not :key
subst
, except that it takes an
association list alist of old-new pairs.
Each element of the tree (after applying the :key
function, if any), is compared with the car
s of
alist; if it matches, it is replaced by the corresponding
cdr
.
&key :test :test-not :key
sublis
.