lua-users home
lua-l archive

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


> Likely I'm a bit naive about this. But couldn't we just define for #
> operator to simply return the size of the array part?

Like I tried to explain earlier [1], the array part is just an implementation
detail. Even if the table is used as an array without holes, some of it may
end up in the hash part. Read the code [2].

[1] http://lua-users.org/lists/lua-l/2010-12/msg00400.html
[2] http://www.lua.org/source/5.1/ltable.c.html#luaH_getn