Lua.VM.Stdlib.Table (Lua v1.0.0-rc.0)
View SourceLua 5.3 table standard library.
Provides functions for table manipulation including insertion, removal, concatenation, sorting, and array operations.
Functions
table.insert(list, [pos,] value)- Inserts element into listtable.remove(list [, pos])- Removes element from listtable.concat(list [, sep [, i [, j]]])- Concatenates list elementstable.sort(list [, comp])- Sorts list in-placetable.pack(...)- Packs arguments into table with 'n' fieldtable.unpack(list [, i [, j]])- Returns elements from listtable.move(a1, f, e, t [, a2])- Moves elements between tables
Metamethod handling
table.insert, table.remove, table.concat, table.move, and
table.sort route every read through __index, every write through
__newindex, and every length lookup through __len. This matches
Lua 5.3 §6.6 and the reference implementation in ltablib.c, which
uses lua_geti/lua_seti/luaL_len for these operations rather than
reaching into the raw table.