lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 6/21/07, Robert Ward <> wrote:
I was puzzled by the results of unpack, below
> x = {'a', 'b', 'c', 'd', 'e'}
> y = {'v', 'w', 'x', 'y', 'z'}
> print(unpack(x), unpack(y))
--> a       v       w       x       y       z

Since unpack returns all the table elements, I was expecting to see
a   b   c   d   e   v   w   x   y   z

Is there a simple explanation of the principle at work here?

    In a function call, all arguments that return lists are
truncated, but the last.