On Thu, Jul 13, 2017 at 6:12 PM, Roberto Ierusalimschy wrote:
I hope you do not expect that the previous sentence ("Parameters
act as local variables that are initialized with the argument
values") applies also to C functions.
[…] we somehow must expect that setmetatable should behave like a "C
function" and not a like a Lua function. […]
Similarly for the next sentence ("A vararg function [...] collects
all extra arguments and supplies them to the function through a
vararg expression"). So, I see no reason to expect that this
particular sentence would apply to C functions.
In fact, the behaviour of C functions can be most easily understood
by assuming they are always vararg. Even then the TNONE/TNIL
difference remains, but at least the "adjustment" is taken out.