I have a problem in use implicit parameter arg
in functions.
The code not works. The documentation, http://www.lua.org/pil/5.2.html, should works.
function listar_um (...)
for i,v in ipairs(arg) do
print("usando args " .. arg[i])
end
end
listar_um("Olá", 1, "Dois")
This code works with the declaring variable lista
.
function listar_um (...)
lista = {...}
for i,v in ipairs(lista) do
print("não usando args " .. lista[i])
end
end
listar_um("Olá", 1, "Dois")
Why the first example does not work?
Script for test: http://www.codeshare.io/IPwRJ Execute on-line script: http://www.compileonline.com/execute_lua_online.php
Thanks.