emacs-devel
[Top][All Lists]
Advanced

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

Re: Using the GNU GMP Library for Bignums in Emacs


From: Stefan Monnier
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Wed, 25 Apr 2018 23:33:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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.

I think I agree, tho I'd describe it differently: the way `eq` is
defined in Common-Lisp, I believe it is valid to make it an alias for
`eql`.

I think Emacs should move in this direction: define `eq` to be the same
as `eql`, then check every use of EQ in the C code to see if it will
necessarily behave identically to "EQL" and where it doesn't, replace it
with EQL.

Obviously, this will cost us some code size and performance, so we'd
also want to try and measure the cost to make sure it's not too serious.


        Stefan




reply via email to

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