[Top][All Lists]

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

Re: bignum branch

From: Eli Zaretskii
Subject: Re: bignum branch
Date: Sun, 05 Aug 2018 18:18:09 +0300

> From: Andy Moreton <address@hidden>
> Date: Sun, 05 Aug 2018 12:36:13 +0100
> >> 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.

Yes, but then how do you access the C structure represented by a Lisp
bignum objects?  The usual way is XBIGNUM(bignum), from which you can
access members other than 'value'.  If XBIGNUM expands into the value,
we will need something else to do what XBIGNUM does now.

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

That's fine, we have a lot of code like

  if (NATNUMP (foo))
    x = XFASTINT (foo);

And sometimes the test is redundant, as its result is known in

reply via email to

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