![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The Murl Engine Lua Addon adds a wide-ranging integration of the Murl framework to the Lua programming language, see http://www.lua.org/license.html
The Lua standard libraries can be opened via the addon's OpenLibrary() method.
The generic iterator for Murl containers Array, Hash, Index, Map, String is Murl.ipairs
The Murl Engine Lua API supports the following native data types.
Number represents real (double-precision floating-point) numbers.
Operations on numbers follow the same rules of the underlying C implementation, which, in turn, usually follows the IEEE 754 standard.
Integer represents signed integer (64 bit) numbers.
The Murl Engine Lua API is using the following rule: If a real number is passed to an integer function parameter, the real value is truncated.
Lua has explicit rules about when integer or real representation is used, but it also converts between them automatically as needed, see the Lua online manual.
A single character or a number.
The char data type simply takes an 8-bit number which can be written as a number value e.g. 65 or a string with exactly 1 character e.g. "A".
The char data type is a special representation for calling the Murl Engine Lua API only.
Boolean is the type of the values false and true.
Both nil and false make a condition false; any other value makes it true.
String represents an immutable sequences of bytes.
The Murl Engine Lua API converts Murl.String implicitly to a native Lua String and vice versa.
Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0').
Nil is the type of the value nil.
The main property of nil is to be different from any other value; it usually represents the absence of a useful value.
The type table implements associative arrays.
That is, arrays that can be indexed not only with numbers, but with any Lua value except nil and NaN (Not a Number, a special numeric value used to represent undefined or unrepresentable results, such as 0/0). Tables can be heterogeneous; that is, they can contain values of all types (except nil). Any key with value nil is not considered part of the table. Conversely, any key that is not part of a table has an associated value nil.