[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: member returns list
From: |
Emanuel Berg |
Subject: |
Re: member returns list |
Date: |
Wed, 02 Sep 2015 23:47:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> The `car' of the result of `member' is the actual
> element you were searching. Since `member' tests
> with `equal', that can be a different object.
OK, so the `car' is the object, however ELT is
searched for with `equal', which compares objects'
"structure and contents". An object obviously have the
same structure and contents when compared to itself,
but nonetheless two objects can have the same
structure and contents in what case the `car' and ELT
are identical but still two objects. Ha! I'm smart...
So then, is there a "member-whatever" that doesn't use
`equal' but one of the many other functions available
to compare items? Is there a "member" to which you can
provide this function yourself?
> But `member' returns a whole sublist. This gives you
> also a simple mean to modify a list, like in this
> example:
>
> (let ((list '(1 2 3 4 5))) (let ((list1 (member 3
> list))) (when list1 (setcar list1 -3)) list))
>
> ==> (1 2 -3 4 5)
Yes, already mentioned but true nonetheless. It would
be interesting to see what programs you guys write
because I never did stuff like that. Perhaps in HPC
with tons of data, or old-school batch "data
processing", this type of stuff is/was legio?
--
underground experts united
http://user.it.uu.se/~embe8573
- member returns list (was: Re: To `boundp' or not to `boundp'?), (continued)
- 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/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 <=
- Re: member returns list, Michael Heerdegen, 2015/09/02
- RE: member returns list, Drew Adams, 2015/09/02
- Re: member returns list, Marcin Borkowski, 2015/09/02
- Re: member returns list, Emanuel Berg, 2015/09/03
- Re: member returns list, Marcin Borkowski, 2015/09/04
- Re: member returns list, Emanuel Berg, 2015/09/05
- Re: member returns list, Random832, 2015/09/05
- Re: member returns list, Emanuel Berg, 2015/09/05
- Re: member returns list, Random832, 2015/09/05
- Re: member returns list, Emanuel Berg, 2015/09/05