dear list,
I have noticed that `table.unpack(list [,i [, j]])` will NOT regards the `n` field in the `list` table,
I know I can write it like this:
```
table.unpack(list, 1, list.n)
```
but will it be a good idea to make it read `n` field in table.unpack?
It certainly is a source if confusion until you notice that not only are pack and unpack *not* the inverse of each other... but that they are not available consistently across Lua implementations. Here's what I always use, from
https://github.com/lua-stdlib/normalize :
local pack = table.pack or function (...)
return { n =select ("#", ...), ...}
end
local table_unpack = table.unpack or unpack
local function unpack (t, i, j)
returntable_unpack (t, tointeger (i) or1, tointeger (j) orlen (t))
end
Why not write a PowerPatch for the lua-wiki that fixes the inconsistency in core too?
thanks and happy new year!
Happy New Year!