lua-users home
lua-l archive

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


On 1/2/2018 6:18 AM, Roberto Ierusalimschy wrote:  ...
As already explained, you can use _ARG; but you can use also any other
name:

   function foo (...=a) print(a.n) end

_ARG is present both for compatibility (the above syntax will not even
compile in older versions) and for the main chunk (which does not have
a header to name this parameter).

 I just love the new syntax. I assume select will continue to work as usual, for old code and for use cases where it works better. The _ARG name makes the parameter name for the main chunk consistent with Lua _NAME practice, a good change. Any code broken by this last change should be an easy fix: a simple search and replace.