[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Do not assume all fixnum literals will be
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Do not assume all fixnum literals will be fixnums at runtime [was: Re: [PATCH][5] types.db entries for the overflow-aware ops] |
Date: |
Wed, 24 May 2017 13:16:58 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, May 24, 2017 at 09:25:15PM +1200, Evan Hanson wrote:
> Hi folks,
>
> Good discussion, thank you Peter and Lemon for considering this.
>
> > diff --git a/lfa2.scm b/lfa2.scm
> > index 0fd4612..4c7ff84 100644
> > --- a/lfa2.scm
> > +++ b/lfa2.scm
> > @@ -173,17 +173,14 @@
> > ;; a simplified variant of the one in scrutinizer.scm
> > (cond ((string? lit) 'string)
> > ((symbol? lit) 'symbol)
> > + ;; Do not assume fixnum width matches target platform's!
> > + ((or (big-fixnum? lit)
> > + (bignum? lit))
> > + 'integer)
> > ((fixnum? lit) 'fixnum)
> > - ((bignum? lit) 'bignum)
> > ((flonum? lit) 'float)
> > ((ratnum? lit) 'ratnum)
> > ((cplxnum? lit) 'cplxnum)
>
> You use `bignum?' for the non-fixnum part of the width check here in
> lfa2.scm, but `small-bignum?' in scrutinizer.scm -- why is that? (This
> is in the chicken-5 patch.)
Good catch, that's just an oversight. Both should use small-bignum?,
and of course that means the bignum? check should be restored.
Cheers,
Peter
signature.asc
Description: Digital signature