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.

pairs()

pairs (t) If t has a metamethod __pairs, calls it with t as argument and returns the first three results from the call. Otherwise

2017-02-21 04:15:41
select()

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)

2017-02-21 04:15:52
rawequal()

rawequal (v1, v2)v1v2__eq

2017-02-21 04:15:45
collectgarbage()

collectgarbage ([opt [, arg]]) This function is a generic interface to the garbage collector. It performs different functions according to its first argument, opt:

2017-02-21 04:10:26
type()

type (v)nilnilnumberstringbooleantablefunctionthreaduserdata

2017-02-21 04:16:26
setmetatable()

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 (

2017-02-21 04:15:53
xpcall()

xpcall (f, msgh [, arg1, ···]) This function is similar to pcall, except

2017-02-21 04:16:41
tostring()

tostring (v)string.format If the metatable of v

2017-02-21 04:16:25
rawset()

rawset (table, index, value)table[index]value__newindextableindexnilvalue This function returns

2017-02-21 04:15:47
assert()

assert (v [, message]) Calls error if the value of its argument v

2017-02-21 04:10:13