6.1 – Basic Functions
The basic library provides core functions to Lua. If you do not include this library in your application, you should check carefully whether you need to provide implementations for some of its facilities.
select (index, ···) If index is a number, returns all arguments after argument number index; a negative number indexes from the end (-1 is the last argument)
rawequal (v1, v2)v1v2__eq
pairs (t) If t has a metamethod __pairs, calls it with t as argument and returns the first three results from the call. Otherwise
collectgarbage ([opt [, arg]]) This function is a generic interface to the garbage collector. It performs different functions according to its first argument, opt:
rawset (table, index, value)table[index]value__newindextableindexnilvalue This function returns
xpcall (f, msgh [, arg1, ···]) This function is similar to pcall, except
tostring (v)string.format If the metatable of v
assert (v [, message]) Calls error if the value of its argument v
type (v)nilnilnumberstringbooleantablefunctionthreaduserdata
setmetatable (table, metatable) Sets the metatable for the given table. (To change the metatable of other types from Lua code, you must use the debug library (
Page 2 of 3