-
Notifications
You must be signed in to change notification settings - Fork 20
and expression
Cameron Purdy edited this page Apr 7, 2020
·
3 revisions
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
a
is the VAS before the expression. - The VAS before
b
is the VAST aftera
. - The VAS after the expression is the join of the VASF after
a
and 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
a
and 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.↩