loadfile()

loadfile ([filename [, mode [, env]]]) Similar to load, but gets the chunk from file filename or from the standard input, if no file name is given.

Local Declarations

3.3.7 – Local Declarations Local variables can be declared anywhere inside a block. The declaration can include an initial assignment: stat ::= local namelist [‘=’ explist] If present, an initial assignment has the same semantics of a multiple assignment (see §3.3.3). Otherwise, all variables are initialized with nil. A chunk is also a block (see §3.3.2), and so local variables can be declared in a chunk outside any explicit block. The visibility rules for local variables are explained i

Logical Operators

3.4.5 – Logical Operators The logical operators in Lua are and, or, and not. Like the control structures (see §3.3.4), all logical operators consider both false and nil as false and anything else as true. The negation operator not always returns false or true. The conjunction operator and returns its first argument if this value is false or nil; otherwise, and returns its second argument. The disjunction operator or returns its first argument if this value is different from nil and false; ot

luaL_addchar

luaL_addchar[-?, +?, m] void luaL_addchar (luaL_Buffer *B, char c); Adds the byte c to the buffer B (see luaL_Buffer).

luaL_addlstring

luaL_addlstring[-?, +?, m] void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); Adds the string pointed to by s with length l to the buffer B (see luaL_Buffer). The string can contain embedded zeros.

luaL_addsize

luaL_addsize[-?, +?, –] void luaL_addsize (luaL_Buffer *B, size_t n); Adds to the buffer B (see luaL_Buffer) a string of length n previously copied to the buffer area (see luaL_prepbuffer).

luaL_addstring

luaL_addstring[-?, +?, m] void luaL_addstring (luaL_Buffer *B, const char *s); Adds the zero-terminated string pointed to by s to the buffer B (see luaL_Buffer).

luaL_addvalue

luaL_addvalue[-1, +?, m] void luaL_addvalue (luaL_Buffer *B); Adds the value at the top of the stack to the buffer B (see luaL_Buffer). Pops the value. This is the only function on string buffers that can (and must) be called with an extra element on the stack, which is the value to be added to the buffer.

luaL_argcheck

luaL_argcheck[-0, +0, v] void luaL_argcheck (lua_State *L, int cond, int arg, const char *extramsg); Checks whether cond is true. If it is not, raises an error with a standard message (see luaL_argerror).

luaL_argerror

luaL_argerror[-0, +0, v] int luaL_argerror (lua_State *L, int arg, const char *extramsg); Raises an error reporting a problem with argument arg of the C function that called it, using a standard message that includes extramsg as a comment: bad argument #arg to 'funcname' (extramsg) This function never returns.