|
ddneilson wrote:
table1 = { "A", "B" } table2 = { "C", "D" } print(unpack(table1))print(unpack(table1), unpack(table2))
Actually, you should *not* expect the above. See http://www.lua.org/manual/5.1/manual.html#2.5.Expected output: A B A B C D
Actual output: A B A C D
This holds for all functions, not just unpack. If the function invocation appears anywhere in the list of arguments to a function, except the last position, its list of return values is adjusted to return just the first value.
If it wasn't midnight, I could probably explain this more clearly. Matt