4 ms·
Bit short-sighted of him to only consider positive array indices IMO. Lua allows them to be negative.
by teamonkey 3y ago
Bit short-sighted of him to only consider positive array indices IMO. Lua allows them to be negative.
- bdowling 3y agoLua also allows floating point indices. In fact, any value can be an index into a table. That means any number, string, True/False, function reference, thread (coroutine) reference, table reference, "userdata" reference (usually a pointer to a C object), or nil can be an index.
- bdowling 3y agoCorrection, any value except nil can be an index into a table. https://www.lua.org/manual/5.3/manual.html#2.1 https://www.lua.org/manual/5.3/manual.html#2.1