[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using the GNU GMP Library for Bignums in Emacs
From: |
Tom Tromey |
Subject: |
Re: Using the GNU GMP Library for Bignums in Emacs |
Date: |
Wed, 25 Apr 2018 21:17:39 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) |
>>>>> "Paul" == Paul Eggert <address@hidden> writes:
Paul> And it depends on what we mean by "unsafe". Is it safe to assume that
Paul> (eq (1+ 0) 1) returns t, for example? The Scheme standard says "no"
Paul> but we might decide that 'eq' should "work" for fixnums in Emacs
Paul> Lisp. That sort of thing.
I would like the "egal" idea to be at least considered: that is, for
immutable objects like bignums (and floats), have "eq" do a value
comparison, not an identity comparison. Ideally we could dispense with
eql entirely.
The upside is that this makes programs simpler to reason about -- to my
mind the eq/eql distinction is letting an implementation leak through
the abstraction.
The downside is that this is less efficient. (Currently my JIT emits
"eq" as a simple comparison, which is nice; but I think on the whole I'd
personally rather trade a bit of performance for the cleaner semantics.)
Tom
- Using the GNU GMP Library for Bignums in Emacs, Siraphob (Ben) Phipathananunth, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Eli Zaretskii, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Siraphob (Ben) Phipathananunth, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Eli Zaretskii, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Siraphob (Ben) Phipathananunth, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Eli Zaretskii, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs,
Tom Tromey <=
- Re: Using the GNU GMP Library for Bignums in Emacs, Stefan Monnier, 2018/04/25
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/04/27
- Re: Using the GNU GMP Library for Bignums in Emacs, Stefan Monnier, 2018/04/27
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, dancol, 2018/04/21
- Re: Using the GNU GMP Library for Bignums in Emacs, Philipp Stephani, 2018/04/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/04/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Daniel Colascione, 2018/04/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Clément Pit-Claudel, 2018/04/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/04/22