|
45 | 45 | An expression may have two roles: it always produces a *value*, and it may have
|
46 | 46 | *effects* (otherwise known as "side effects"). An expression *evaluates to* a
|
47 | 47 | value, and has effects during *evaluation*. Many expressions contain
|
48 |
| -sub-expressions (operands). The meaning of each kind of expression dictates |
49 |
| -several things: |
| 48 | +sub-expressions, called the *operands* of the expression. The meaning of each |
| 49 | +kind of expression dictates several things: |
50 | 50 |
|
51 | 51 | * Whether or not to evaluate the sub-expressions when evaluating the expression
|
52 | 52 | * The order in which to evaluate the sub-expressions
|
@@ -85,11 +85,14 @@ in the order given by their associativity.
|
85 | 85 | | `=` `+=` `-=` `*=` `/=` `%=` <br> `&=` <code>|=</code> `^=` `<<=` `>>=` | right to left |
|
86 | 86 | | `return` `break` closures | |
|
87 | 87 |
|
88 |
| -## Evaluation order |
| 88 | +## Evaluation order of operands |
89 | 89 |
|
90 |
| -Most expressions include subexpressions. Unless otherwise stated on the |
91 |
| -expression's page, evaluation of these inner expressions is left to right as |
92 |
| -written in the source code. |
| 90 | +Unless otherwise stated on the expression's page, evaluation of the operands of |
| 91 | +an expression is done before applying the effect of the expression. The operands |
| 92 | +are executed left to right as written in the source code. |
| 93 | + |
| 94 | +> **Note**: Which subexpressions are the operands of an expression is |
| 95 | +> determined by expression precedence as per the previous section. |
93 | 96 |
|
94 | 97 | For example, the two `next` method calls will always be called in the same
|
95 | 98 | order:
|
|
0 commit comments