Re: meta-comment on typing
Per Bothner 06 Oct 2005 07:20 UTC
Marcin 'Qrczak' Kowalczyk wrote:
> Per Bothner <xxxxxx@bothner.com> writes:
>
>
>>Since it *optional* static typing, I'm assuming that the specific
>>operations are "consistent" in the sense of the following example:
>>
>>If (and (fixnum? x) (fixnum? y))
>>then: (eqv? (+ x y) (fx+ x y))
>
>
> It's not the same: (fx+ x y) returns a fixnum even if it overflows.
As I wrote: I'm *assuming* that + when operating on fixnums
will return a fixnum even if it "overflows".
I.e. that arithmetic on fixnums are defined "modularly" and
fixnums are *not* just a subset of the integers.
This implies that (fixnum? 0) is not true, though of course 0
can be trivially *converted* to a fixnum: (fixnum? (as <fixnum> 0))
is true.
I can see that this might be a bit too radical.
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/