Next: , Previous: , Up: Well-formedness   [Contents][Index]


11.8 Well-formedness – Valued Actions and Calls

Both actions and function calls can be valued, and as such are considered to be expressions. The places where they can be called are severely restricted. The main reason is that actions and function calls (at least the functions that contain actions) cause a side effect. The order of evaluation in complex expressions becomes an issue when side effects are considered. In order to exclude that, valued actions and function calls can only occur in isolation at the right hand side of an assignment or variable definition, or (since version 2.14.0) in simple if-expressions and reply-expressions.

An extra restriction to this rule is put on the initial value of a global variable in a behavior. Such an expression can not contain actions or function calls at all, since actions are only allowed within an on.