Subject: Re: (eql x y) = T and (equal x y) = NIL
From: (Rob Warnock)
Date: Tue, 10 Feb 2009 19:32:16 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Pascal J. Bourguignon <> wrote:
| pereges <> 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 Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607