Subject: Re: Pass by value
From: (Rob Warnock)
Date: Tue, 10 Feb 2009 18:50:32 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Tobias C. Rittweiler <> wrote:
| (Rob Warnock) writes:
| > ... [Reminder: EQ *defines* "object identity".] ...
| EQL does, for meaningful values of "object identity". :-)

While I would not normally bicker about this sort of snipe, in
this case I really must insist that we stick to the CLHS here:

    Function EQ
    Returns true if its arguments are the same, identical object;
    otherwise, returns false

    Function EQL
    The value of EQL is true of two objects, x and y, in the
    following cases:
    1. If x and y are EQ.
    2. If x and y are both numbers of the same type and the same value.
    3. If they are both characters that represent the same character.
    Otherwise the value of EQL is false. 

In Common Lisp, EQ is the *only* meaningful value of "object identity".

What EQL measures is "(default) sameness", that is, "indistinguishable
by EQL (if no predicate is implied by context)", to paraphrase the CLHS
Glossary entry "Same(2)". As that entry continues:

    Since EQ is used only rarely in this specification, EQL is the
    default predicate when none is mentioned explicitly.

So to summarize:

EQ == "identical".
EQL == "same" (unless context overrides).

I don't think it could be much more clear than that.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607