Lua 5.2 Reference Manual Pdf

In other languages Add links. Moderate or good, occasionally poor later. For example, foo or bar will only call bar if foo returns false or nil as its first value. The environments used by all standard library functions and Scribunto library functions are protected. If time is given, it is the time to be formatted see os.

Free software movement History Open-source-software movement Organizations Events. Returns true if a language code is of a valid form for the purposes of internal customisation of MediaWiki.

Every table may have an associated table known as a metatable. In this case, the parentheses around the argument list may be omitted. This compares titles by interwiki prefix if any as strings, then by namespace number, then by the unprefixed title text as a string. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Number constants are specified using a period.


The article is about the Lua programming language itself. For this reason, the expensive function count is incremented the first time one of them is accessed for a page other than the current page. For performance reasons, frame. Returns the parent node under which the current node was created. Returns a string that is the concatenation of n copies of the string s.

Functions are created using the function keyword, and called using parentheses. Lua at Wikipedia's sister projects. Otherwise the current time is used.

Extension Scribunto/Lua reference manual - MediaWiki

If pattern matches the empty string, s will be split into individual characters. In the first form, a value of nil causes any property with the given name to be unset if it was previously set. All use the standard interpretation where nil and false are considered false and anything else is considered true. If this is used, ClassName Tests. See Function declarations and Function calls below for details.

Please consider expanding the lead to provide an accessible overview of all important aspects of the article. This has implication for functions that deal with the call stack, such as getfenv and debug. If timestamp is omitted, the default is the current time.

Lua provides functions to push and pop most simple C data types integers, floats, etc. This table holds the sequence of searcher functions to use when loading modules.

Moderate becoming rough, occasionally very rough later. Note that wrapping a function call or vararg expression in parentheses will lose all except the first value. Captures are numbered according to their left parentheses.

Returns a list of supported hashing algorithms, for use in mw. Each searcher function is called with a single argument, the name of the module to load. The expensive function count will be incremented if the title object created is not for a title that has already been loaded.

Navigation menu

The result of a relational operator is always a boolean. Also see Ustring patterns for a similar pattern-matching scheme using Unicode characters. The text library provides some common text processing functions missing from the String library and the Ustring library.

Navigation menuLua (programming language)

Names starting with an underscore followed by uppercase letters are reserved for internal Lua global variables. Returns a string or a table containing date and time, formatted according to format. Be sure to run the Scribunto test cases with your library loaded, even if your library doesn't itself provide any test cases. Syntactic sugar is available for named functions, local functions, and functions that act like member functions to a table. This table holds loader functions, used by the first searcher Scribunto includes in package.

Extension Scribunto/Lua reference manual - MediaWiki

Tables are always passed by reference see Call by sharing. Capture references can appear in the pattern string itself, sql query practice pdf and refer back to text that was captured earlier in the match. The title referenced will be counted as linked from the current page. The purpose of the original post was to point out other places in the manual where this particular change of terminology may be desirable.

List of applications using Lua. Thank you for the feedback.

Within a precedence level, most binary operators are left-associative, i. Looks for the first match of pattern in the string.

Downalod the pdf version of the manual

Re Lua 5.2 Reference Manual

When no more keys are available, returns nil. From the Lua side, such a module appears as a namespace table holding its functions and variables. Such data structures may be used freely within Lua, including as the return values of modules loaded with mw. Many Lua functions operate only on sequences, and ignore non-positive-integer keys.

Re Lua 5.2 Reference Manual

Downalod the pdf version of the manual

This manual documents Lua as it is used in MediaWiki with the Scribunto extension. All tables and their metatables are reconstructed from scratch. Because such use is very common, Lua features a special syntax for accessing such fields.