gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] more on evenp bug


From: Camm Maguire
Subject: Re: [Gcl-devel] more on evenp bug
Date: 21 Mar 2002 12:07:02 -0500

Greetings!

Lou Glassy <address@hidden> writes:

> [...stuff deleted...]
>    > My host is a Debian GNU/Linux 2.2 system (Intel Celeron cpu).
>    > 
> 
>    Good to see your choice of OS :-)
> 
> Yeah, it's a rock-solid platform.  I'm very pleased with it.
> 
>    > Looking through the source code, it looks like something
>    > is happening in gcl/o/num_pred.c, in the function number_evenp().
>    > Somehow when we exceed 32 bits in size (is this when we switch from 
>    > using fixnums to bignums?), something goes berzerk.
> 
>    Yes, I concur.  I looked at this a few days ago, at it appears that
>    the code is there to handle the bignums, but the *reader* is not
>    detecting a bignum from the input string, and is truncating to an
>    integer.  
> 
>    You seem to know a bit about lisp.  Is there anything like a C "type
>    cast" which can force an item to be stored as a bignum?  I doubt it
>    actually.  
> 
> As best I know, the distinction between a fixnum and a bignum is not
> really made in the Lisp language itself.  To Lisp, it's turtles all 
> the way down -- there is a COERCE function, but it doesn't seem to 
> do what you're thinking of.
> 

Thanks!

>    OK, the best thing is to compile with -g, run under gdb, break at
>    number_evenp, do a backtrace "bt", and see where the input was
>    generated and how the lisp object was setup as a fixnum.  I'll try to
>    do this when I get time, but if you are in a hurry, this is the way
>    I'd go.
> 
> I'll have a go at this, this weekend.  Thanks for the ideas.  In the 
> meantime, I have a workaround for my code - it'll be interesting to 
> see how this bug happens, since GCL 2.2.1 seems not to have this problem.
> "Something has changed in The Matrix..."  :-)
> 

OK, probably was introduced with gmp.  Thanks for the observation!
Did you ever get a change to look into this over the weekend?

I've added this to the bug list on the website.

Take care,

> Thanks
> 
> Lou (address@hidden)
> 
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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