select()

select (index, ···) If index is a number, returns all arguments after argument number index; a negative number indexes from the end (-1 is the last argument). Otherwise, index must be the string "#", and select returns the total number of extra arguments it received.

require()

require (modname) Loads the given module. The function starts by looking into the package.loaded table to determine whether modname is already loaded. If it is, then require returns the value stored at package.loaded[modname]. Otherwise, it tries to find a loader for the module. To find a loader, require is guided by the package.searchers sequence. By changing this sequence, we can change how require looks for a module. The following explanation is based on the default configuration for pac

Relational Operators

3.4.4 – Relational Operators Lua supports the following relational operators: ==: equality ~=: inequality <: less than >: greater than <=: less or equal >=: greater or equal These operators always result in false or true. Equality (==) first compares the type of its operands. If the types are different, then the result is false. Otherwise, the values of the operands are compared. Strings are compared in the obvious way. Numbers are equal if they denote the same mathemat

rawset()

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

rawlen()

rawlen (v)v__len

rawget()

rawget (table, index)table[index]__indextableindex

rawequal()

rawequal (v1, v2)v1v2__eq

print()

print (···)stdouttostringprintstring.formatio.write

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.

pcall()

pcall (f [, arg1, ···]) Calls function f with the given arguments in protected mode. This means that any error inside f is not propagated; instead, pcall catches the error and returns a status code. Its first result is the status code (a boolean), which is true if the call succeeds without errors. In such case, pcall also returns all results from the call, after this first result. In case of any error, pcall returns false plus the error message.