lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Rici Lake wrote:
Well, the nice thing about % (and //) is that they don't add any precedence levels. I agree that adding precedence levels
complicates things very quickly -- I can never remember all of
C's, for example, and always over-parenthesize bitwise operators.
So perhaps one of the criteria would have to do with that.

Come to think of it, the fact that in C, << and >> have higher precedence than & ^ | seems unintuitive (I recall having read the even C creators regret this design choice) and has bitten me already. In the unlikely hypothesis that these operators get implemented, should the authors keep the historical precedence (easier to handle for C people, easier to convert C code to Lua) or a more logical one?

I admit that using functions calls solves this problem at once. ;-)

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --