Lua: understanding table array part and hash part
In section 4, Tables, in The Implementation of Lua 5.0 there is and example: local t = {100, 200, 300, x = 9.3} So we have t[4] == nil . If I write t[0] = 0 , this will go to hash part . If I write t[5] = 500 where it will go? Array part or hash part ? I would eager to hear answer for Lua 5.1, Lua 5.2 and LuaJIT 2 implementation if there is difference. Contiguous integer keys starting from 1 always go in the array part. Keys that are not positive integers always go in the hash part. Other than that, it is unspecified, so you cannot predict where t[5] will be stored according to the spec (and