lua-users home
lua-l archive

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




Le mar. 13 août 2019 à 06:45, Sean Conner <sean@conman.org> a écrit :
It was thus said that the Great Griffin Rock once stated:

> Proposed ability to 'mark' an argument in an imperative function call to
> transform it into an assignment statement. Can be implemented as a purely
> syntactic translation with no change to the behaviour of the function or
> interpreter. Syntax below uses unary '&' like c pointers and c++ reference
> signatures.

  '&' is used in Lua 5.3+ as the logical AND operator, so it might be a poor
choice.  Perhaps '@' (the AT symbol) is better.
 
in my opinion using '='  as a unary operator (instead of the normal binary infix operator) would even be better; either as a prefix:
    trim(x, =veryLongName, z)
    string.gsub(=line, '%s+', ' ')
or suffix:
    trim(x, veryLongName=, z)
    string.gsub(line=, '%s+', ' ')