lua-users home
lua-l archive

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


Le sam. 8 juin 2019 à 10:18, Lorenzo Donati <lorenzodonatibz@tiscali.it> a écrit :
On 08/06/2019 07:55, Egor Skriptunoff wrote:
> On Fri, Jun 7, 2019 at 12:35 AM Lorenzo Donati wrote:
> P.P.S. Prefix-ish and postfix-ish approaches are just a mirror of
> each other. Neither is better than another.

OOF! Nice points. Thanks!

That's false, the prefix-ish and postfix-ish approaches are not equivalent. Notably the postfix-ish style does not allow annotating unary expressions:
   -x(:annotation)
unless you use extra parentheses:
   -(x(:annotation))
or
   (-x)(:annotation)

But it does occur with the prefix-ish style (which is currently proposed with "local *toclose x", except that the leading token is a "*" instead of a ":", but this does not change the syntaxic problem as both tokens are binary operators) that behaves like other unary operators (with a right associativity):
   -(:annotation)x