and expression - xtclang/xvm GitHub Wiki
The logical “and” expression is a well-known expression form:
a && b
The type of the expressions a and b must both be Boolean. The implicit type of the expression is Boolean.
If the expression a yields False, then the expression yields False[1]. If the expression a yields True, then the expression yields the result of the expression b.
The expression short-circuits if either expression a or b short-circuits.
Definite assignment rules:
- The VAS before
ais the VAS before the expression. - The VAS before
bis the VAST aftera. - The VAS after the expression is the join of the VASF after
aand the VAS afterb. - The VAST after the expression is the VAST after
b. - The VASF after the expression is the join of the VASF after
aand the VASF afterb.
The AndExpression groups to the left, so a && b && c is treated as (a && b) && c:
AndExpression:
EqualityExpression
AndExpression && EqualityExpression
This is often referred to as "short-circuit logic", but that term is not used here, in order to avoid confusion with the Ecstasy concept of short-circuiting expressions.↩