From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
"Pip Cet" <pipcet@gmail.com>,
emacs-devel@gnu.org
Subject: Re: Bug#38708: eq vs eql in byte-compiled code
Date: Wed, 01 Jan 2020 10:45:55 -0500 [thread overview]
Message-ID: <jwva777p4x2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <8cd1b5b2-b94e-ce64-0d70-c1b8b012d685@cs.ucla.edu> (Paul Eggert's message of "Tue, 31 Dec 2019 09:38:18 -0800")
>> For example, this code will produce t:
>> (defun my-eq (a b) (eq a b))
>> (defun f () (xor (eq 1.0 1.0) (my-eq 1.0 1.0)))
>> (byte-compile 'f)
>> (f)
Such paradoxes are just what you get from using `eq`.
We could eliminate this one in some ad-hoc way, but there'd still be a
million others. AFAIK people here have decided (to my chagrin) that
`eq` should stay distinct from `eql`, so these paradoxes are considered
as "features".
> How about going a bit further, and globally deduplicating all flonums
> and bignums that result from low-level text-to-number conversion and
> module imports?
I don't see the benefit. All it would do, AFAICT, is to make it more
difficult to "manually" reproduce/show those eq-paradoxes, so people
will be even more stumped when their code gets nil whereas redoing the
test by hand with M-: returns t (which again, is part of the "fetureset"
of `eq`, but still).
We could/should do hash-consing of bignums, tho. It won't affect code
that doesn't use bignums, and should have a fairly minor performance
cost for bignums while making their semantics more clean.
Stefan
next prev parent reply other threads:[~2020-01-01 15:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-31 15:07 Bug#38708: eq vs eql in byte-compiled code Pip Cet
2019-12-31 15:51 ` Andrea Corallo
2019-12-31 16:05 ` Mattias Engdegård
2019-12-31 17:38 ` Paul Eggert
2020-01-01 12:38 ` Mattias Engdegård
2020-01-02 8:38 ` Paul Eggert
2020-01-02 17:26 ` Mattias Engdegård
2020-01-04 19:55 ` Stefan Monnier
2020-01-22 10:56 ` Mattias Engdegård
2020-01-25 0:59 ` Paul Eggert
2020-01-01 15:45 ` Stefan Monnier [this message]
2020-01-02 7:52 ` Paul Eggert
2020-01-02 12:27 ` Pip Cet
2020-01-02 23:12 ` Paul Eggert
2020-01-02 13:48 ` Eli Zaretskii
2020-01-04 18:54 ` Stefan Monnier
2020-01-04 19:33 ` Paul Eggert
2020-01-04 19:49 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwva777p4x2.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=mattiase@acm.org \
--cc=pipcet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.