I was using arg as an argument name for a function:
function foo(cmd, arg)
-- etc.
end
I just learned arg is a special, hidden variable that represents a table of arguments when using variable arguments:
function foo(bar, baz, ...)
-- `arg` now holds arguments 3 and up
end
Should I expect any issues with using arg as an argument name in my code?
I knew that it would cause problems but wasn't sure of what it was in specific. So I decided to try it myself.
I tried the function displayed on your example, and got a stack overflow error.
And according to the official lua website,
So I think it is best to stay away from calling your parameters "arg"