|
CS 3304: Comparative Languages
|
Guarded Selection
if <boolean> -> <statement>
[] <boolean> -> <statement>
...
[] <boolean> -> <statement>
fi
- Semantics: when this construct is reached,
- Evaluate all boolean expressions
- If more than one are true, choose one nondeterministically
- If none are true, it is a runtime error
- Idea: if the order of evaluation is not important, the program should not specify one
- See book examples (p. 319)