[Top][All Lists]

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

Re: Using the GNU GMP Library for Bignums in Emacs

From: Paul Eggert
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Tue, 10 Jul 2018 10:45:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/10/2018 09:48 AM, Helmut Eller wrote:
If so, why would someone want to specialize a method just for fixnums,
as opposed to a method for integers?
Some important functions only for fixnums but not for bignums.
E.g. goto-char or aref.

Both of these functions have limits that are not relevant to fixnums; they have limits based on something else. For example, goto-char is limited to point-min..point-max, and aref is limited to 0..length-1. We will want both functions to work on bignums, since we will want to allow buffer sizes and bool vector lengths that do not fit into fixnums.

And even if these functions' limits were relevant to fixnums, I don't see why one would want to specialize a method just for fixnums as opposed to settling for specializing it to integers. The method would accept an integer, and then if it used a fixnum-only goto-char or aref that would signal an error, just as it would for any other out-of-range integer. There would be no need to specialize the method to fixnums.

So I'm still not seeing the actual use cases that would suggest that (type-of 5) should not continue to return 'integer'.

reply via email to

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