coroutine.running()

coroutine.running () Returns the running coroutine plus a boolean, true when the running coroutine is the main one.

lua_stringtonumber

lua_stringtonumber[-0, +1, –] size_t lua_stringtonumber (lua_State *L, const char *s); Converts the zero-terminated string s to a number, pushes that number into the stack, and returns the total size of the string, that is, its length plus one. The conversion can result in an integer or a float, according to the lexical conventions of Lua (see §3.1). The string may have leading and trailing spaces and a sign. If the string is not a valid numeral, returns 0 and pushes nothing. (Note that the

luaL_setmetatable

luaL_setmetatable[-0, +0, –] void luaL_setmetatable (lua_State *L, const char *tname); Sets the metatable of the object at the top of the stack as the metatable associated with name tname in the registry (see luaL_newmetatable).

lua_pcallk

lua_pcallk[-(nargs + 1), +(nresults|1), –] int lua_pcallk (lua_State *L, int nargs, int nresults, int msgh, lua_KContext ctx, lua_KFunction k); This function behaves exactly like lua_pcall, but allows the called function to yield (see §4.7).

lua_setupvalue

lua_setupvalue[-(0|1), +0, –] const char *lua_setupvalue (lua_State *L, int funcindex, int n); Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. Returns NULL (and pops nothing) when the index n is greater than the number of upvalues. Parameters funcindex and n are as in function lua_getupvalue.

math.tan()

math.tan (x) Returns the tangent of x (assumed to be in radians).

io.close()

io.close ([file]) Equivalent to file:close(). Without a file, closes the default output file.

Patterns

6.4.1 – Patterns Patterns in Lua are described by regular strings, which are interpreted as patterns by the pattern-matching functions string.find, string.gmatch, string.gsub, and string.match. This section describes the syntax and the meaning (that is, what they match) of these strings. Character Class: A character class is used to represent a set of characters. The following combinations are allowed in describing a character class: x: (where x is not one of the magic characters ^$()%.[]

lua_copy

lua_copy[-0, +0, –] void lua_copy (lua_State *L, int fromidx, int toidx); Copies the element at index fromidx into the valid index toidx, replacing the value at that position. Values at other positions are not affected.

math.ceil()

math.ceil (x) Returns the smallest integral value larger than or equal to x.