It's not a problem. Just Lua is amazing.
t = {1, 2, 3}
print(table.unpack(t)) -->1 2 3
print(0, table.unpack(t)) -->0 1 2 3
print(table.unpack(t), 4) -->1 4
What?
It's not a problem. Just Lua is amazing.
t = {1, 2, 3}
print(table.unpack(t)) -->1 2 3
print(0, table.unpack(t)) -->0 1 2 3
print(table.unpack(t), 4) -->1 4
What?
The problem boils down to assigning values to variables, let me simplify the question:
You don't have to give the variables a name when using "..." but it's following the same rules and
table.unpackreturns multiple values. In the Lua 5.2 Reference Manual under point 3.4 it says:I did take me a while to figure that out, it's a good question you asked there.