chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] 32 bit integers?


From: Kon Lovett
Subject: Re: [Chicken-users] 32 bit integers?
Date: Wed, 23 May 2007 09:17:46 -0700


On May 23, 2007, at 6:33 AM, Dan Muresan wrote:

The SRFI-60 egg, per the SRFI document, exports bitwise-* & and arithmetic-shift, which override the definitions in the library unit. It probably should at least rename them before the override. I will do this & release an update SRFI-60. (Personally I don't think the aliases are a good idea but that is the SRFI.)

The strictest interpretation of the aliasing requirement that I can concieve of is that

(eq? bitwise-ior logior)

returns true. I don't think the SRFI mandates the reference implementation to be used. Therefore, you could simply alias logior to mean bitwise-ior etc.

This would solve the bug, right?

Yes. What I did was a Q&D placeholder. W/O a real review of the semantics of SRFI-60 I didn't feel comfortable w/ the above.

W/ the numbers egg the reference implementation will work w/ bignums. (Interesting given that GMP uses sign-magnitude & not 2s-complement.) While the document speaks of fixnums, it uses the term interchangeably with integer.

Maybe the log* operations could have a broader definition of 'integer' than the bitwise-* operations.

But, it might be best to be true to the spirit of the SRFI. In any case, the bit fiddling/logic operations on bignums should be done by GMP so a SRFI-60 extension for the numbers egg is a good idea.

Best Wishes,
Kon


-- Dan





reply via email to

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