[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: member returns list (was: Re: To `boundp' or not to `boundp'?)
From: |
Drew Adams |
Subject: |
RE: member returns list (was: Re: To `boundp' or not to `boundp'?) |
Date: |
Tue, 1 Sep 2015 17:10:56 -0700 (PDT) |
> Yes, and I have wondered about that. Is it useful,
> perhaps with the use of `car' (?) as in:
> (car (member 2 '(1 2 3))) ; 2
> (car (member 0 '(1 2 3))) ; nil
Yes, extremely useful.
> Or is it some "leftover optimization" thing where
> `cdr' is faster than returning `t', and can be used
> the same way? Or is it something else?
No and no.
It's an access function, like `assoc' or `elt'.
If no such member can be found then it returns nil,
which means that it can also function as a simple
membership test.
- To `boundp' or not to `boundp'?, Alexander Shukaev, 2015/09/01
- Re: To `boundp' or not to `boundp'?, Dmitry Gutov, 2015/09/01
- Message not available
- Re: To `boundp' or not to `boundp'?, Barry Margolin, 2015/09/01
- RE: To `boundp' or not to `boundp'?, Drew Adams, 2015/09/01
- member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?),
Drew Adams <=
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?), Drew Adams, 2015/09/01
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?), Drew Adams, 2015/09/02
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/02
- Message not available
- Re: member returns list, Pascal J. Bourguignon, 2015/09/03
- Re: member returns list, Emanuel Berg, 2015/09/03
- Re: member returns list, Michael Heerdegen, 2015/09/02
- Re: member returns list, Emanuel Berg, 2015/09/02
- Re: member returns list, Michael Heerdegen, 2015/09/02