Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie's question

0 views
Skip to first unread message

John Cohen

unread,
Mar 26, 2000, 3:00:00 AM3/26/00
to
what is the easiest way to tell if (car L) is a member of (cdr L).
I only need T or NIL as output, thanks for advice...


Sent via Deja.com http://www.deja.com/
Before you buy.

Pierre R. Mai

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
John Cohen <kms...@my-deja.com> writes:

> what is the easiest way to tell if (car L) is a member of (cdr L).
> I only need T or NIL as output, thanks for advice...

(member (car l) (cdr l))

But what are you really trying to achieve? Maybe a higher-level
function might be more suitable...

Regs, Pierre.

--
Pierre Mai <pm...@acm.org> PGP and GPG keys at your nearest Keyserver
"One smaller motivation which, in part, stems from altruism is Microsoft-
bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]

Thomas A. Russ

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to

(find (car L) (cdr L))
or
(member (car L) (cdr L))

--
Thomas A. Russ, USC/Information Sciences Institute t...@isi.edu

0 new messages