| Date: Sun, 06 Sep 2009 11:16:19 +0200 | From: Antonio Vieiro <[email protected]> | | ... | R6RS#Section 11.4.5: | | "A cond expression is evaluated by evaluating | the test expressions of successive cond clauses in order | until one of them evaluates to a true value (see section 5.7). | When a test evaluates to a true value, then the remaining..." | | (That doesn't allow concurrent evaluation of test expressions) | | That could be rephrased as: | | "A cond expression is evaluated by evaluating the test expressions | in some unspecified order. For the first test expression that | evaluates to true, the remaining..." | | (Or something similar, that allows concurrent evaluation of test | expressions, but that imposes that the first one evaluating to | true, if any, is the one selected for the remaining stuff).
What you are suggesting is very similar to Dijkstra's Guarded-If <http://en.wikipedia.org/wiki/Guarded_Command_Language#Selection:_if> Selection: if The selection (often called the "conditional statement" or "if statement") is a list of guarded commands, of which one is chosen to execute. If more than one guard is true, one statement is nondeterministically chosen to be executed. If none of the guards are true, the result is undefined. Because at least one of the guards must be true, the empty statement "skip" is often needed. Syntax if G0 → S0 [] G1 → S1 ... [] Gn → Sn fi Semantics Upon execution of a selection all guards are evaluated. If none of the guards evaluates to true then execution of the selection aborts, otherwise one of the guards that has the value true is chosen non-deterministically and the corresponding statement is executed. It may be useful to add, but don't confuse it with COND. _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
