table.unpack() compatibility

Mar 5, 2015 at 3:35 AM
table.unpack() is not currently compatible with the Lua standard. Consider the following code:
local t = {7}
local u = table.unpack(t,1,1)

if u == nil then
 print('unpack is nil')

In NeoLua, unpack returns nil. In "" unpack returns 7. NeoLua is using the end argument as exclusive while the standard uses the end argument as inclusive.

The workaround is to use "table.unpack(t,1,2)".
Mar 5, 2015 at 11:33 AM
I do not like one based arrays :).

Fix on github

Is this ok?
Mar 5, 2015 at 6:06 PM
Yes, unpack works fine now.