[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua 5.3.0: operator precedence
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 31 Mar 2014 17:26:47 +0200
The manual says:
3.4.8 – Precedence
Operator precedence in Lua follows the table below, from lower to
< > <= >= ~= ==
* / // %
not # - (unary)
The new bit operators are not in here.
Lua 5.3.0 (work2) Copyright (C) 1994-2014 Lua.org, PUC-Rio
I.e. shifts have a lower precedence than addition, as in C.
In fact, lower even than concatenation, which is not in C.
> 1 << 16 .. 8
But higher than the logical operators.
The C analogy suggests that the other bit operators will be
even lower down, between the comparison operators and
the junction operators.
Can we take this as the way it will be, or does the fact that it
is undocumented imply that it is open to discussion?