[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.3.0 manual: can we have the operator precedence table reversed?
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Mon, 05 Jan 2015 15:13:33 +0100
On 05/01/2015 14:22, Roberto Ierusalimschy wrote:
Since v5.3 is close to finalization, I just throw in a suggestion about
something (trivial) that has always bugged me: can we have the table of
operator precedence reversed (section 3.4.8)? Not a big deal, but every
time I look at it it feels upside-down. In every refman I've seen,
higher precedence operators are placed, well, higher. Not so important,
but I find it distracting (my brain automatically searches in the
"wrong" direction - but maybe it's just me).
At least Python lists them like Lua:
Ouch! My memory failed me! I haven't touched almost any line of Python
since I discovered Lua :-) and I practiced it only for some months
before then. I was sure it was in the reverse order.
My copy of Stroustrup (C++) and K&R ISO C both have the table in the
reverse direction (just double checked now ;-).
In Java the language specification has no table, and the precedence is
expressed in the grammar, the same as ECMAscript (which IIRC is the
references with a spelled-out table in the order I remembered:
For C++ and C see also  and .
But, as I said, not a big problem (as long as the table remains short :-)