error()

error (message [, level])messageerror Usually, error adds some information about the error position at the beginning of the message, if the message is a string. The level argument specifies how to get the error position. With level 1 (the default), the error position is where the error function was called. Level 2 points the error to where the function that called error was called; and so on. Passing a level 0 avoids the addition of error position information to the message.

dofile()

dofile ([filename])dofilestdindofiledofile

debug.upvaluejoin()

debug.upvaluejoin (f1, n1, f2, n2) Make the n1-th upvalue of the Lua closure f1 refer to the n2-th upvalue of the Lua closure f2.

debug.traceback()

debug.traceback ([thread,] [message [, level]]) If message is present but is neither a string nor nil, this function returns message without further processing. Otherwise, it returns a string with a traceback of the call stack. The optional message string is appended at the beginning of the traceback. An optional level number tells at which level to start the traceback (default is 1, the function calling traceback).

debug.upvalueid()

debug.upvalueid (f, n) Returns a unique identifier (as a light userdata) for the upvalue numbered n from the given function. These unique identifiers allow a program to check whether different closures share upvalues. Lua closures that share an upvalue (that is, that access a same external local variable) will return identical ids for those upvalue indices.

debug.setuservalue()

debug.setuservalue (udata, value) Sets the given value as the Lua value associated to the given udata. udata must be a full userdata. Returns udata.

debug.setupvalue()

debug.setupvalue (f, up, value) This function assigns the value value to the upvalue with index up of the function f. The function returns nil if there is no upvalue with the given index. Otherwise, it returns the name of the upvalue.

debug.setmetatable()

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

debug.setlocal()

debug.setlocal ([thread,] level, local, value) This function assigns the value value to the local variable with index local of the function at level level of the stack. The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call getinfo to check whether the level is valid.) Otherwise, it returns the name of the local variable. See debug.getlocal for more information about variable indices and names.

debug.sethook()

debug.sethook ([thread,] hook, mask [, count]) Sets the given function as a hook. The string mask and the number count describe when the hook will be called. The string mask may have any combination of the following characters, with the given meaning: 'c': the hook is called every time Lua calls a function; 'r': the hook is called every time Lua returns from a function; 'l': the hook is called every time Lua enters a new line of code. Moreover, with a count different from zero, the