Просмотр исходного кода

Merge pull request #26 from K-Guan/patch-2

Fixed the incorrect part in "Associativity"
Swaroop C H 10 лет назад
Родитель
Сommit
bbdeee5bae
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      op_exp.asciidoc

+ 12 - 3
op_exp.asciidoc

@@ -227,9 +227,18 @@ expression, then you can write something like `(2 + 3) * 4`.
 === Associativity
 === Associativity
 
 
 Operators are usually associated from left to right. This means that operators with the same
 Operators are usually associated from left to right. This means that operators with the same
-precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 +
-3) + 4`. Some operators like assignment operators have right to left associativity i.e. `a = b = c`
-is treated as `a = (b = c)`.
+precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 + 3) + 4`. 
+
+Assignment operators are the same. For example, `a = b = c` is treated as: 
+
+[source,python]
+--------------------------------------------------
+temp = c
+a = temp
+b = temp
+--------------------------------------------------
+
+In this case `temp` is a temporary variable, actually it does not exist, or we can say it will be deleted then.
 
 
 === Expressions
 === Expressions