emacs-devel
[Top][All Lists]
Advanced

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

Re: Warn about comparing quoted lists (etc) using `eq`


From: Juanma Barranquero
Subject: Re: Warn about comparing quoted lists (etc) using `eq`
Date: Thu, 15 Dec 2022 08:00:19 +0100



On Thu, Dec 15, 2022 at 7:37 AM Dr. Arne Babenhauserheide <arne_bab@web.de> wrote:

> Is this guaranteed or just an implementation detail?

That depends on how you interpret it. IIRC, that all "" are the same object was done to avoid having tons of "" in pure space. So in that sense, is guaranteed. And, as such, the warning is superfluous in this specific case.

Anyway, as documented, that identical constant strings are different objects is, in general, an implementation detail, and the same goes for floats:

Emacs Lisp Reference, 2.8 Equality Predicates

          (eq 3.0 3.0)
               ⇒ t or nil
          ;; Equal floats may or may not be the same object.

          (eq "asdf" "asdf")
               ⇒ t or nil
          ;; Equal string constants or may not be the same object.


reply via email to

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