Search results
Results from the WOW.Com Content Network
Main page; Contents; Current events; Random article; About Wikipedia; Contact us; Pages for logged out editors learn more
Invalid function name: len = string.long(my_str) - The string-length operator is hash mark '#' (as in: #my_str), or use function 'string.len(my_str)' but trying to use unknown function 'string.long(my_str)' will successfully pass during the pre-compile of edit-save, yet it will hit "Script error" when that portion of the Lua script is executed.
Besides the lack of print(), there are other features missing – see Differences from standard Lua for a complete list. At the present time, it is advisable to use mw.ustring functions instead of string , because the latter sometimes fails with Unicode characters.
Lua (as of 5.1) provides a limited form of multiple quoting, particularly to allow nesting of long comments or embedded strings. Normally one uses [[ and ]] to delimit literal strings (initial newline stripped, otherwise raw), but the opening brackets can include any number of equal signs, and only closing brackets with the same number of signs ...
Line continuation – escapes a newline to continue a statement on the next line Some languages define a special character as a terminator while some, called line-oriented , rely on the newline . Typically, a line-oriented language includes a line continuation feature whereas other languages have no need for line continuation since newline is ...
Marshalling data between C and Lua functions is also done using the stack. To call a Lua function, arguments are pushed onto the stack, and then the lua_call is used to call the actual function. When writing a C function to be directly called from Lua, the arguments are read from the stack. Here is an example of calling a Lua function from C:
This Lua module is used in system messages, and on approximately 744,000 pages, or roughly 1% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. 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 .
Aerospike Database uses Lua as its internal scripting language for its 'UDF' (User Defined Function) capabilities, similar to procedures; Apache HTTP Server can use Lua anywhere in the request process (since version 2.3, via the core mod_lua module).