luaL_optinteger

luaL_optinteger[-0, +0, v] lua_Integer luaL_optinteger (lua_State *L, int arg, lua_Integer d); If the function argument arg is an integer (or convertible to an integer), returns this integer. If this argument is absent or is nil, returns d. Otherwise, raises an error.

rawlen()

rawlen (v)v__len

luaL_loadbufferx

luaL_loadbufferx[-0, +1, –] int luaL_loadbufferx (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode); Loads a buffer as a Lua chunk. This function uses lua_load to load the chunk in the buffer pointed to by buff with size sz. This function returns the same results as lua_load. name is the chunk name, used for debug information and error messages. The string mode works as in f

lua_newthread

lua_newthread[-0, +1, m] lua_State *lua_newthread (lua_State *L); Creates a new thread, pushes it on the stack, and returns a pointer to a lua_State that represents this new thread. The new thread returned by this function shares with the original thread its global environment, but has an independent execution stack. There is no explicit function to close or to destroy a thread. Threads are subject to garbage collection, like any Lua object.

debug.setmetatable()

debug.setmetatable (value, table) Sets the metatable for the given value to the given table (which can be nil). Returns value.

utf8.len()

utf8.len (s [, i [, j]])sijij

luaL_loadstring

luaL_loadstring[-0, +1, –] int luaL_loadstring (lua_State *L, const char *s); Loads a string as a Lua chunk. This function uses lua_load to load the chunk in the zero-terminated string s. This function returns the same results as lua_load. Also as lua_load, this function only loads the chunk; it does not run it.

lua_rotate

lua_rotate[-0, +0, –] void lua_rotate (lua_State *L, int idx, int n); Rotates the stack elements between the valid index idx and the top of the stack. The elements are rotated n positions in the direction of the top, for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.

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.

lua_resume

lua_resume[-?, +?, –] int lua_resume (lua_State *L, lua_State *from, int nargs); Starts and resumes a coroutine in the given thread L. To start a coroutine, you push onto the thread stack the main function plus any arguments; then you call lua_resume, with nargs being the number of arguments. This call returns when the coroutine suspends or finishes its execution. When it returns, the stack contains all values passed to lua_yield, or all values returned by the body function. lua_resume ret