On Fri, Dec 25, 2009 at 4:21 PM, Klaus Schilling
<address@hidden> wrote:
As a function, gor needs to have its arguments evaluated before the
actual application takes place, moreover, the order of evaluation is
not specified.
Hence
(define x 0)
(gor (= x 0) (/ x))
gives a numerical overflow error,
whereas
(define x 0)
(or (= x 0) (/ x))
returns true.
If the terms to be evaluated contain non-commutable side effects,
things get out of control, whereas in the macro `or', you may rely on
the order of the side effects.
Yes, Klaus. I forgot that Scheme adopts applicative-order evaluation (after experiencing Haskell for quite a while).
I do see the necessity of your proposal for normal-order evaluation as default, Stephen, ;)