emacs-devel
[Top][All Lists]
Advanced

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

Re: bignum branch


From: Andy Moreton
Subject: Re: bignum branch
Date: Sun, 05 Aug 2018 12:36:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

On Sat 04 Aug 2018, Eli Zaretskii wrote:

>> From: Andy Moreton <address@hidden>
>> Date: Fri, 03 Aug 2018 20:16:05 +0100
>> 
>> Yes. Also perhaps change XBIGNUM to:
>> 
>>     INLINE struct Lisp_Bignum *
>>     XBIGNUM (Lisp_Object a)
>>     {
>>       eassert (BIGNUMP (a));
>>       return XUNTAG (a, Lisp_Misc, struct Lisp_Bignum)->value;
>>     }
>> 
>> That allows "XBIGNUM(value)->value" to be replaced with "XBIGNUM(value)"
>> in all callers.
>
> That would go against the convention with all the other Xfoo macros.

True, the only thing with similar behaviour being xmint_pointer. While
inconsistent with the other Xfoo macros, it does reduce visual clutter
in the callers.

> However, I see your point, and so perhaps an additional macro,
> XINTEGER, could call either XINT or XBIGNUM()->value, depending on the
> argument type?

I'm not sure that would help, as callers still need to know if the
result is a bignum or fixnum to handle it correctly.

    AndyM




reply via email to

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