Skip to content

Commit

Permalink
Merge pull request swaroopch#26 from K-Guan/patch-2
Browse files Browse the repository at this point in the history
Fixed the incorrect part in "Associativity"
  • Loading branch information
swaroopch committed Jan 7, 2016
2 parents 687239f + 8f298c6 commit bbdeee5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions op_exp.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,18 @@ expression, then you can write something like `(2 + 3) * 4`.
=== Associativity

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

Expand Down

0 comments on commit bbdeee5

Please sign in to comment.