On Sat, 2009-09-05 at 23:28 -1000, Shiro Kawai wrote:
> Just a comment on concurrent evaluation of test exprs in cond:
...
> Doesn't that prohibit typical idioms in which the tests assume 
> precedent tests are not satisfied?  For example, the following
> code assumes when (odd? x) is evaluated x is an integer.  If we
> allow concurrent evaluation, (odd? x) may signals an error.
> 
> (cond
>   [(not (integer? x)) ...]
>   [(odd? x) ...])

That is very true.  I don't know about anybody else, but I 
rely on forms that promise sequential evaluations to prevent 
evaluating expressions that will give an error.

This includes 

* short-circuit evaluation of 'and'
* short-circuit evaluation of 'or'
* sequential evaluation of test expressions in 'cond'
* 'if' evaluating the test before the consequent or the alternate clause 
* 'if' evaluating consequent or alternate but not both

If any of those things changes, a *lot* of code, probably 
almost *all* code, will break.  Now, it wouldn't be the first 
time that a standards body has made a change that invalidated 
all programs written before that standard *cough*R6RS*cough*, 
but the code in this case would be a heck of a lot harder to 
fix.

                                Bear


                                Bear




_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to