使用unpack()函数:function test(a,b,c) print(a+b+c) end myargs = {1,2,3} test(unpack(myargs)) -- prints "6"
unpack()
函数被移动到了table
表中。因此,示例变为test(table.unpack(myargs))
。 - Solomon Slow