code for unevaluated Boolean and conditional expressions



["Robert Dodier" <robert.dodier at gmail.com>, Wed, 3 May 2006 20:47:51 -0600]:
> f (x, y) := if equal (y, 0) then 0 else 1/x $
...
> f (0, y);  =>  error: simplification of 1/0

Isn't this unfortunate?  I think it should be

    f (0, y);  =>  if equal(y, 0) then 0 else 1/0

so that the error is delayed until the test can be decided.  That way

    f0y: f(0,y) $
    f0y, y:0;  =>  0

is equivalent to f(0,0) as it seems it should be.

Maybe it would be sufficient to just catch any errors, and return the
unevaluated boolean instead.

Thanks for your work,

Albert.