Kaz Kylheku
9/30/2015 2:38:00 PM
On 2015-09-30, Jim Newton <jimka.issy@gmail.com> wrote:
> It would be great if FIND and FIND-IF returned a second value indicating
> whether the sought item was found or not. Otherwise it is hard to know
> whether NIL was the element it found.
>
> sigh :-(
Use MEMBER or MEMBER-IF, if the sequence is a list. These return the
list's cons cell which holds the element, if it is found, otherwise NIL.
If you get a cons cell, then the element is in the CAR.
If the code has to generalize to arrays, then POSITION and POSITION-IF
get you the index of the item if it is found, whereas the not-found
case returns NIL.