[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics
From: |
Andy Wingo |
Subject: |
Re: [PATCH] Fast R6RS div/mod; improved extensibility of numerics |
Date: |
Mon, 31 Jan 2011 20:26:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
On Mon 31 Jan 2011 18:35, Mark H Weaver <address@hidden> writes:
> Andy Wingo <address@hidden> writes:
>>> The last patch might be slightly controversial. Although it does not
>>> make `integer-expt' a generic function, nonetheless it can now
>>> exponentiate _any_ scheme object that can be multiplied using `*'.
>>
>> To me this is fine, in principle; but I wonder about causing `(expt #t
>> 0)' to produce 1. It seems that in any case the range of the output
>> should be continuous -- i.e. if (expt <my-matrix> 1) produces a matrix,
>> and (expt <my-matrix> n) for n > 1 makes a matrix, then (expt
>> <my-matrix> 0) should also produce a matrix. Or no?
>
> When using generic arithmetic operators, there's no way to return
> objects of the correct type in all corner cases like this.
Well... OK! I'm feeling reckless, so I'm applying and pushing your
patch. Here goes nothing!
Andy
--
http://wingolog.org/