Paul Schlie <xxxxxx@comcast.net> writes:
>> My toy Scheme interpreter is hosted by a language with native bignums,
>> and no distinction between fixnums and bignums in the public API.
>> A requirement to support modular arithmetic would be inconvenient here.
>
> - then (integer-range) for your implementation would be fairly large, and
> no ambiguity exists unless the maximum bignum value is overflowed.
integer-range is not feasible because in the current implementation
for most machines the memory for representing the maximum overflows
earlier than the theoretical limit of the representation. The actual
range is not well defined for this reason.
Arithmetic is definitely not modular wrt. this range. Overflow of
bignums should generate exceptions, but since it's unimplementable
with my choice of the bignum library (GMP), the current implementation
crashes. This is a known bug which won't be fixed in the foreseeable
future.
--
__("< Marcin Kowalczyk
\__/ xxxxxx@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/