Next: Well-formedness -- Injection, Previous: Well-formedness -- Reply, Up: Well-formedness [Contents][Index]
Both action
s and function call
s 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 action
s and
function calls
(at least the functions that contain
action
s) 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 action
s and function call
s 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
action
s or function call
s at all, since action
s are
only allowed within an on
.
• Action in member variable initializer | ||
• Action used in a complex expression | ||
• Call in member variable initializer | ||
• Call used in a complex expression | ||
• Action value discarded | ||
• Call value discarded |