help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: member


From: Emanuel Berg
Subject: Re: member
Date: Fri, 04 Sep 2015 02:24:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:

> If you just want a more concise result

I'm fine using `member' as a "false predicate", and
I don't think it is bad or that it should be changed.

> you can use position or find instead of member.
> As predicates, they're equivalent.

`find' seems to be the same and thus better than `car'
+ member. `position' is good when what should be
determined is the... position of the item.

    (find 2 '(1 2 3 4))       ; 2
    (find 6 '(1 2 3 4 5))     ; nil
    (position 1 '(1 2 3 4))   ; 0 (zero-indexed; N.B. (when 0 t) ; t)
    (position 6 '(1 2 3 4 5)) ; nil

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]