simp.lisp



On Jan 24, 2008 3:28 PM, Rupert Swarbrick <rupert.swarbrick at lineone.net>
wrote:

> For example I noticed that (*red1 '((rat) 0 0)) => 0. This isn't
> necessarily a problem, but should one write a test for it?
>

This implies that a precondition of *red1 is that the denominator is not 0.

If you really wanted full checking:

1) add code to give an error in *red for d=0 (it would be nice if there were
a better mechanism for asserting preconditions)
2) but don't check that n, d are integers, because gcd does the check
2a) the truly paranoid would check anyway, because some future version of CL
might allow rational or Gaussian integer arguments to gcd
3) try to prove to myself that *red/*red1 is never called with d=0
4) in *red1, check that there are exactly 2 arts to rat

(1) is the only one that seems worth doing, though.

          -s