Operator Precedence
Table 5, Operator precedence shows all the Erlang operators in order of descending priority together with their associativity. Operator precedence and associativity are used to determine the evaluation order in unparenthesized expressions.
Operators | Associativity |
| |
| |
(unary) | |
| Left associative |
| Left associative |
| Right associative |
| |
| |
| |
| Right associative |
|
Expressions with higher priority (higher up in the table) are
evaluated first, and then expressions with lower priority are evaluated. So, for
example, to evaluate 3+4*5+6
, we first evaluate the
subexpression 4*5
, since ( ...
Get Programming Erlang, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.