This as the most simple example as I can imagine:
function NewPrint(...)
print("printed:", ...)
end
NewPrint("Hi")
Please note, I haven't actually done Lua for a while, I might have missed some syntax.
This as the most simple example as I can imagine:
function NewPrint(...)
print("printed:", ...)
end
NewPrint("Hi")
Please note, I haven't actually done Lua for a while, I might have missed some syntax.
As per the Lua.org documentation , it was 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.
The syntax in function definition has been introduced in Lua 5.0 (manual) Lua 2.5 (thanks to Luiz for correcting me), but it required to use arg
table when you wanted to access those varargs. This has been fixed in Lua 5.1, which allowed to use ...
notation for definitions and access to varargs.