lua-users home
lua-l archive

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

> All feedback welcome. Thanks.

I am surprised by the result of the following command:

Lua 5.2.0  Copyright (C) 1994-2011, PUC-Rio
> print(table.unpack(table.pack(1,2,3)))
> print(table.unpack{1,2,3})
1       2       3

So it looks like table.pack performs in some cases worse than the
trivial table constructor !
I understand that it sets field "n", which shall be passed to
table.unpack for a guaranteed behavior.
Still, I would have expected that when there is no nil argument,
unpack should return all pack arguments.