Re: Common Lisp solved this problem 20 years ago Per Bothner 27 Oct 2005 05:41 UTC
Thomas Bushnell BSG wrote: > Per Bothner <xxxxxx@bothner.com> writes: > > >>Taylor Campbell wrote: >> >>>Coercion to integers of a given modulus, for >>>example, from other integers, is accomplished with a procedure we >>>already have in R5RS, namely MODULO; >> >>Not the same. The coercion creates a value with a different run-time >>type, such that the generic + operator uses modulo arithmetic. > > > Can you coerce to fixnum a number which is bigger than maxint, and > reliably get modulus, or would that coercion be an error? Either is plausible, but I think the former makes more sense. The Kawa implementation sort-of-does the modulus. ("Sort-of" because the implementation currently only handles unboxed "private" Java numebr types, and their representation/coercion to/from Objects is incomplete and buggy.) -- --Per Bothner xxxxxx@bothner.com http://per.bothner.com/