Skip to content
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 after a.
  • The VAS after the expression is the join of the VASF after a and the VAS after b.
  • 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 after b.

The AndExpression groups to the left, so a && b && c is treated as (a && b) && c:

    AndExpression:
        EqualityExpression
        AndExpression && EqualityExpression

[1]

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.