[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are two symbols `equal' iff they are `eq'?

From: Marcin Borkowski
Subject: Re: Are two symbols `equal' iff they are `eq'?
Date: Sun, 09 Aug 2015 17:46:54 +0200

On 2015-08-09, at 17:28, Drew Adams <address@hidden> wrote:

>> As in the subject; neither the manual nor the docstring for `equal'
>> are very clear on this.  (The docstring for `equal' says: "Symbols must
>> match exactly.", which -- I would guess -- means `eq', but I'm not
>> sure.)
> Yes.  `equal' requires symbols to have the same name, value,
> function definition, and plist, and to be interned in the same
> obarray.  They need to be the same Lisp object (a symbol).
> In sum: they need to be `eq'.

Do I get it right that for two symbols to be `eq' it is enough for them
to have the same name and to be interned in the same obarray?

> Emacs Lisp doesn't have a spec (just its code, and some doc).
> But this is what the Common Lisp spec says about `equal' for
> symbols:
>  Returns true if x and y are structurally similar (isomorphic)
>  objects.  Objects are treated as follows by equal.
>  * Symbols, Numbers, and Characters
>    equal is true of two objects if they are symbols that are eq,
>                                             ^^^^^^^^^^^^^^^^^^^
>    if they are numbers that are eql, or if they are characters
>    that are eql.


Marcin Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

reply via email to

[Prev in Thread] Current Thread [Next in Thread]