Subject: Re: member function...
From: (Rob Warnock)
Date: 12 Sep 2000 03:23:50 GMT
Newsgroups: comp.lang.lisp
Message-ID: <8pk7k6$rjipm$>
Irma <> wrote:
| I have a problem using a member function  ...
| ? (setf testlist (cons "Two" testlist))
| ("Two" "One")
| ? (member testword testlist)
| Shouldn't it return T since "One" is in the testlist or I should
| another function for this situation?

The problem is not "member" per se, but an interaction between
your choice of list element data type (string) and the function
"eql", which is the default two-argument test that "member" uses
if you don't specify a different one. That is:

	> (eql 1 1)
	> (member 1 '(2 1))
	> (eql 'one 'one)
	> (member 'one '(two one))
	> (eql "one" "one")
	> (member "one" '("two" "one"))
	> (equal "one" "one")	; or any of equalp, string-equal, or string=
	> (member "one" '("two" "one") :test #'equal)

Does that help?


Rob Warnock, 41L-955
Network Engineering
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043