Skip to content

Commit bbdeee5

Browse files
committed
Merge pull request swaroopch#26 from K-Guan/patch-2
Fixed the incorrect part in "Associativity"
2 parents 687239f + 8f298c6 commit bbdeee5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

op_exp.asciidoc

+12-3
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,18 @@ expression, then you can write something like `(2 + 3) * 4`.
227227
=== Associativity
228228

229229
Operators are usually associated from left to right. This means that operators with the same
230-
precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 +
231-
3) + 4`. Some operators like assignment operators have right to left associativity i.e. `a = b = c`
232-
is treated as `a = (b = c)`.
230+
precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 + 3) + 4`.
231+
232+
Assignment operators are the same. For example, `a = b = c` is treated as:
233+
234+
[source,python]
235+
--------------------------------------------------
236+
temp = c
237+
a = temp
238+
b = temp
239+
--------------------------------------------------
240+
241+
In this case `temp` is a temporary variable, actually it does not exist, or we can say it will be deleted then.
233242

234243
=== Expressions
235244

0 commit comments

Comments
 (0)