lua_topointer

lua_topointer[-0, +0, –] const void *lua_topointer (lua_State *L, int index); Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value. Typically this function is used only for hashing and debug information.

lua_tostring

lua_tostring[-0, +0, m] const char *lua_tostring (lua_State *L, int index); Equivalent to lua_tolstring with len equal to NULL.

Concatenation

3.4.6 – Concatenation The string concatenation operator in Lua is denoted by two dots ('..'). If both operands are strings or numbers, then they are converted to strings according to the rules described in §3.4.3. Otherwise, the __concat metamethod is called (see §2.4).

lua_istable

lua_istable[-0, +0, –] int lua_istable (lua_State *L, int index); Returns 1 if the value at the given index is a table, and 0 otherwise.

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 ^$()%.[]

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.

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.

luaL_newmetatable

luaL_newmetatable[-0, +1, m] int luaL_newmetatable (lua_State *L, const char *tname); If the registry already has the key tname, returns 0. Otherwise, creates a new table to be used as a metatable for userdata, adds to this new table the pair __name = tname, adds to the registry the pair [tname] = new table, and returns 1. (The entry __name is used by some error-reporting functions.) In both cases pushes onto the stack the final value associated with tname in the registry.

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).