From: smartnose
Subject: How to test whether a list has a certain atom?
Date: 
Message-ID: <5088b623-73ed-426a-ae52-e6d95a5f8d5c@u28g2000hsc.googlegroups.com>
Is there something like containp?

Otherwise I have to write my own function to loop and search in the
list.

If possible, I also want this container to be efficient so that the
existence of an object can be tested using binary search or hash
table?

Thanks.

From: Kenny
Subject: Re: How to test whether a list has a certain atom?
Date: 
Message-ID: <48e6e850$0$4959$607ed4bc@cv.net>
smartnose wrote:
> Is there something like containp?
> 
> Otherwise I have to write my own function to loop and search in the
> list.
> 
> If possible, I also want this container to be efficient so that the
> existence of an object can be tested using binary search or hash
> table?

Well then you do not want a Lisp (linked) list. You could do a binary 
search with a vector, a hashed search with a hash table.

kt
From: alien_guy
Subject: Re: How to test whether a list has a certain atom?
Date: 
Message-ID: <pan.2008.10.04.02.40.24@l.org>
On Fri, 03 Oct 2008 19:28:22 -0700, smartnose wrote:

> Is there something like containp?

member
From: Rainer Joswig
Subject: Re: How to test whether a list has a certain atom?
Date: 
Message-ID: <joswig-231CD4.10071904102008@news-europe.giganews.com>
In article 
<····································@u28g2000hsc.googlegroups.com>,
 smartnose <·········@gmail.com> wrote:

> Is there something like containp?
> 
> Otherwise I have to write my own function to loop and search in the
> list.

MEMBER works for lists. FIND works for sequences (lists, vectors, strings, ..).

> 
> If possible, I also want this container to be efficient so that the
> existence of an object can be tested using binary search or hash
> table?

Then you may want to use a hash table.

See the Common Lisp Hyperspec for the various facilities
in the language. Also some other book as an introduction might
be useful - if you don't have one already. Graham's book
ANSI Common Lisp gives a compact overview.

> 
> Thanks.

-- 
http://lispm.dyndns.org/