Search results
Results from the WOW.Com Content Network
Finds the size of a key/value pair table (associative array). For example, for {foo = 'foo', bar = 'bar'}, size will return 2. The function will also work on arrays, but for arrays it is more efficient to use the # operator. Note that to find the size, this function uses the pairs function to iterate through all of the keys.
A table is a sequence, optionally supplemented by named keys: digit["two"]="2". Several table functions like table.concat will only work with the numbered values and ignore named keys. The metatable offers a large, optional set of methods for altering table behavior. For example, you can define a table to be callable like a function.
Lua provides functions to push and pop most simple C data types (integers, floats, etc.) to and from the stack, and functions to manipulate tables through the stack. The Lua stack is somewhat different from a traditional stack; the stack can be indexed directly, for example. Negative indices indicate offsets from the top of the stack.
In Lua, "table" is a fundamental type that can be used either as an array (numerical index, fast) or as an associative array. The keys and values can be of any type, except nil. The following focuses on non-numerical indexes. A table literal is written as { value, key = value, [index] = value, ["non id string"] = value }. For example:
This Lua module is used on approximately 421,000 pages, or roughly 1% of all pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox .
Lua can process text strings in excess of 230,000 characters, which allows the formatted contents of article pages to be used as input to string searches. However, there have been some limitations in string contents, such as hidden strings enclosed in nowiki-tag or pre-tag elements.
Retail sales increased in November amid a strong start to the holiday shopping season.
Help:Lua debugging – a how-to guide about debugging Lua modules; Help:Lua for beginners – basic tutorial and pointers; Wikipedia:Lua string functions – string performance considerations and limits; Wikipedia:Guide to Scribbling – how to write templates that use Scribunto/Lua