help-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Joost Kremers
Subject: Re: Are two symbols `equal' iff they are `eq'?
Date: 9 Aug 2015 00:31:08 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

Marcin Borkowski 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.)

Quoting the description of `equal` in the Elips manual:

,----
|  -- Function: equal object1 object2
|      This function returns `t' if OBJECT1 and OBJECT2 have equal
|      components, and `nil' otherwise.  Whereas `eq' tests if its
|      arguments are the same object, `equal' looks inside nonidentical
|      arguments to see if their elements or contents are the same.  So,
|      if two objects are `eq', they are `equal', but the converse is not
|      always true.
`----

(info "(elisp) Equality Predicates")

Seems to me to be very clear: objects can be `equal` without being `eq`.
(But they cannot be `eq` if they're not `equal`.)



-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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