Hi,
I saw on this link that i should avoid unpack().
http://docs.coronalabs.com/guide/basics/optimization/index.html
here is my Example code:
local opts = {
“image01.jpg”,100,300
}
local function returnArgs(opt)
local vars = “”
local op = “”
for i = 1,#opt do
vars = vars…opt[i]…","
op = op… “([^,]+)”…","
end
return vars:match(op)
end
print(unpack(opts))
–display.newImage(returnArgs(opts))
–display.newImage(unpack(opts))
this code allow me to use a table as an argument of any API.
Is it better to use unpack or this other function?
How bad is to use Unpack?
Is there any other solution to return ther arguments of a function?
Thank you very much.