这是我能想象到的最简单的例子:
function NewPrint(...)
print("printed:", ...)
end
NewPrint("Hi")
请注意,我实际上已经有一段时间没有使用 Lua,我可能错过了一些语法。
最佳答案
根据 Lua.org documentation ,它是 Lua 5.1。
Lua 5.1 was released on 21 Feb 2006. Its main new features were a new module system, incremental garbage collection, new mechanism for varargs, new syntax for long strings and comments, mod and length operators, metatables for all types, new configuration scheme via luaconf.h, and a fully reentrant parser.
关于lua - 在 Lua 函数中作为参数引入的 (...) 是什么版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17176283/