lua - 在 Lua 函数中作为参数引入的 (...) 是什么版本?

标签 lua parameter-passing argument-passing

这是我能想象到的最简单的例子:

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/

相关文章:

iphone - 尝试将 CGrect 传递给 PerformSelector withObject

c - 传递指针变量以存储字符串数组(命令行参数)

Lua获取最大数量

c - 我的 C-Lua 混合程序中的字符串连接

Lua 脚本,这是一个键还是索引?

methods - Go中的参数传递

c++ - 使用Lua创建HTML GUI(HTML渲染)

function - 在 Clojure 中创建一个函数,该函数在其他命名空间中创建 'n' 个 JButton,每个 JButton 具有不同的 'actionPerformed' 方法

powershell - 如何将 switch 参数传递给另一个 PowerShell 脚本?

c - 函数参数的内存位置