On Mon 31 Jan 2011 18:35, Mark H Weaver <[email protected]> writes: > Andy Wingo <[email protected]> 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/
