Subject: Re: (eql x y) = T and (equal x y) = NIL
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 10 Feb 2009 19:32:16 -0600
Newsgroups: comp.lang.lisp
Message-ID: <JYudnYob-IY9tw_UnZ2dnUVZ_hydnZ2d@speakeasy.net>
Pascal J. Bourguignon <pjb@informatimago.com> wrote:
+---------------
| pereges <Broli00@gmail.com> writes:
| > What exactly is the difference between eql and equal ?
| 
| Coarsely,
| EQL is the identity,
| EQUAL is the shallow structural equality,
| EQUALP is the deep structural equality.
+---------------

Slightly less coarsely:

EQ is object identity.
EQL is "sameness" (EQ plus "same" type/value characters & numbers).
EQUAL is deep structural equality on a very few specified types:
  it only "descends into" conses, arrays, and pathnames.
EQUALP is like EQUAL but additionally "descends into" structures and
  hash tables as well, and it also ignores case on characters/strings.

When in doubt, use EQL. That's what the CLHS means by "same", by default.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607