Grouping and Order of Evaluation
AMPS expressions allow you to group parts of the expression using parentheses. Parts of an expression inside parentheses are evaluated together. 60East recommends using parentheses to group independent parts of an expression to ensure that the expression is evaluated in the expected order. For example, in this expression:
The clause /counter % 3
is evaluated first, and the result of that evaluation is compared to 0
.
Within a group, elements are evaluated left to right in precedence order. For example, given the filter below:
AMPS evaluates expression2
, then expression3
(since AND
has higher precedence than OR
), and if they evaluate to false, then expression1
will be evaluated.
AMPS does not guarantee that all parts of an expression will be evaluated if the result of an expression can be determined after only evaluating part of the expression. For example, given the expression:
AMPS only guarantees that B_FUNCTION(/b)
will be evaluated if A_FUNCTION(/a)
returns false
.
Last updated