[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Atoms in association lists
I wonder how Gold Hill would handle the example on p. 281 of CLtL, i.e., a
NIL appearing in place of a pair in the a-list and an invocation of
(assoc nil a-list). Steele notes that (assoc item list :test fn) is
equivalent to (find item list :test fn :key #'car) *except* in this case,
because the FIND will take the CAR of NIL and succeed with NIL while the
ASSOC "will ignore the NIL in the a-list and continue to search for an
actual pair (cons) whose CAR is NIL." I rather suspect that the Gold Hill
implementation will fail to make this distinction, and if so I would consider
this a bug (no matter how special the case may be).