lua_checkstack

lua_checkstack[-0, +0, –] int lua_checkstack (lua_State *L, int n); Ensures that the stack has space for at least n extra slots (that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, either because it would cause the stack to be larger than a fixed maximum size (typically at least several thousand elements) or because it cannot allocate memory for the extra space. This function never shrinks the stack; if the stack already has space for

luaL_loadfilex

luaL_loadfilex[-0, +1, m] int luaL_loadfilex (lua_State *L, const char *filename, const char *mode); Loads a file as a Lua chunk. This function uses lua_load to load the chunk in the file named filename. If filename is NULL, then it loads from the standard input. The first line in the file is ignored if it starts with a #. The string mode works as in function lua_load. This function returns the same results as lua_load, but it has an extra erro

lua_arith

lua_arith[-(2|1), +1, e] void lua_arith (lua_State *L, int op); Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods). The value of op must be one of the following constants: LUA_OPADD: performs addition (+

lua_pushnumber

lua_pushnumber[-0, +1, –] void lua_pushnumber (lua_State *L, lua_Number n); Pushes a float with value n onto the stack.

debug.getupvalue()

debug.getupvalue (f, up) This function returns the name and the value of the upvalue with index up of the function f. The function returns nil if there is no upvalue with the given index. Variable names starting with '(' (open parenthesis) represent variables with no known names (variables from chunks saved without debug information).

io.flush()

io.flush () Equivalent to io.output():flush().

lua_isnone

lua_isnone[-0, +0, –] int lua_isnone (lua_State *L, int index); Returns 1 if the given index is not valid, and 0 otherwise.

rawset()

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

luaL_where

luaL_where[-0, +1, m] void luaL_where (lua_State *L, int lvl); Pushes onto the stack a string identifying the current position of the control at level lvl in the call stack. Typically this string has the following format: chunkname:currentline: Level 0 is the running function, level 1 is the function that called the running function, etc. This function is used to build a prefix for error messages.

Precedence

3.4.8 – Precedence Operator precedence in Lua follows the table below, from lower to higher priority: or and < > <= >= ~= == | ~ & << >> .. + - * / // % unary operators (not # - ~) ^ As usual, you can use parentheses to change the precedences of an expression. The concatenation ('..') and exponentiation ('^') operators are right associative. All other binary operators are left associative.