[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Manual bug on REMOVE
Yes, this is true. However, the example given in the manual is on assoc lists:
(setq gems (pairlis '(jade ruby)'(black red))) => ((RUBY . RED) (JADE . BLACK))
The manual says "You can use the generalized sequence function REMOVE to remove
an indicator and value pair from an association list. REMOVE finds the first
instance of a cons whose car is EQL to the indicator, and removes the pair
from the association list."
In this context, the "cons" refers to a member of the assoc list, not to the
conses making up the list; and the "car of the cons" refers to RUBY and JADE.
This is supported by the example, which says
X X "(remove 'ruby gems) => ((JADE . BLACK))" [sic][paraphrased].
It is necessary to use ":key #'car" to obtain the desired results.