lua-users home
lua-l archive

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


>PS: Maybe it might be a nice proposol,
>to use an already existing "unary reserved
>char" to enforce that this should work for
>the next function

The rule is pretty simple and perfectly reasonable IMO. Each comma separated entry in an expression list represents exactly one item, with a special exception for the last, which can represent a so called vararg of multiple values. This makes multiple assignments (and function argument evaluation) much more intuitive and thus easier to read and debug.

If you want varargification to work, put the function that returns multiple values at the end of the list. 

If you want two varargifications, just use two lists with one vararg item at the end of each.

print(string.byte(…))
print(string.byte(…))