[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: Fri, 6 Jul 2018 14:00:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Tom Tromey wrote:

1. Should the C core change the names of things like NUMBERP to FIXNUMP?
    Similarly should make_number -> make_fixnum?

Yes, we should keep things clear in the C core, and this would definitely be clearer. Please do it as a separate commit, though.

2. What is (type-of 5)?  Right now 'integer, but arguably perhaps
    'fixnum is correct.  Gerd's branch did this.

'integer', for the same reason that (type-of 5) doesn't return 'natnum'. fixnum and natnum are both subtypes of integer, and the basic type is integer. The other ways of doing this would cause more trouble to user code.

3. Should intbig_to_lisp et al be converted to use bignums?
    I'm inclined to say no, for compatibility.

Yes, that function should now return only fixnums and bignums (assuming GMP is available). Of course the reverse functions that converts lisp to C integer also needs to work with bignums in C range.

4. Should it be possible to make a "low-valued bignum"?

No, as too much Lisp code depends on eq acting like = on fixnums. Although this will not work for bignums (unless we take Stefan's suggestion...), it should continue to work on integers that can fit into fixnum range.

Thanks for working on this!

reply via email to

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