aboutsummaryrefslogtreecommitdiff
path: root/modules/lua/api/_G.luadoc
blob: 45fbe8fc346344d9c45df3210bc923615c3fad02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- * `_G`: Holds global environment, setfenv changes environments.
-- * `_VERSION`: Current interpreter version "Lua 5.0".
--- Error if v nil or false, otherwise returns v.
function assert(v [, message])
--- Set threshold to limit KBytes, default 0, may run GC.
function collectgarbage([limit])
--- Executes as Lua chunk, default stdin, returns value.
function dofile(filename)
--- Terminates protected func, never returns, level 1(default), 2=parent.
function error(message [, level])
--- Returns dynamic mem in use(KB), and current GC threshold(KB).
function gcinfo()
---
-- Gets env, f can be a function or number(stack level, default=1), 0=global
-- env.
function getfenv(f)
--- Returns metatable of given object, otherwise nil.
function getmetatable(object)
--- Returns an iterator function, table t and 0.
function ipairs(t)
---
-- Loads chunk without execution, returns chunk as function, else nil plus
-- error.
function loadfile(filename)
--- Links to dynamic library libname, returns funcname as a C function.
function loadlib(libname, funcname)
--- Loads string as chunk, returns chunk as function, else nil plus error.
function loadstring(string [, chunkname])
--- Returns next index,value pair, if index=nil(default), returns first index.
function next(table [, index])
---
-- Returns the next function and table t plus a nil, iterates over all key-value
-- pairs.
function pairs(t)
---
-- Protected mode call, catches errors, returns status code first
--(true=success).
function pcall(f, arg1, arg2, ...)
--- Prints values to stdout using tostring.
function print(e1, e2, ...)
--- Non-metamethod v1==v2, returns boolean.
function rawequal(v1, v2)
--- Non-metamethod get value of table[index], index != nil.
function rawget(table, index)
--- Non-metamethod set value of table[index], index != nil.
function rawset(table, index, value)
--- Loads package, updates _LOADED, returns boolean.
function require(packagename)
---
-- Sets env, f can be a function or number(stack level, default=1), 0=global
-- env.
function setfenv(f, table)
--- Sets metatable, nil to remove metatable.
function setmetatable(table, metatable)
--- Convert to number, returns number, nil if non-convertible, 2<=base<=36.
function tonumber(e [, base])
--- Convert to string, returns string.
function tostring(e)
--- Returns type of v as a string.
function type(v)
--- Returns all elements from list.
function unpack(list)
--- pcall function f with new error handler err.
function xpcall(f, err)