System information
Manual:Lua
48
values of non-boolean type were causing an error.
• Logical 'and' and 'or' operators ('&&' and '||') now use shortcut evaluation. If left hand value is sufficient for
computing the operation, it is returned and the right hand value is not computed. Otherwise, operation returns the
right hand value. Example:
put (9 or (1 / 0)) #prints 9, division is not computed
Changes in Lua compared to the standard release
•• Lua base version is 5.1.4
•• Number type is 64 bit signed integer. Floating point constants are not supported. Exponentiation does not work
with negative exponents.
•• Following patches are applied:
• Byte swapping for loading bytecode [2].
• Patch by Thierry Grellier that adds '&' '|' '^^' '<<' '>>' '~' bitwise operators. Integer division operator is not
included. [3]
•• Following libraries are included:
• bitlib [4], adapted for 64 bit integer numbers.
• md5 1.1.2 [5]
• lpeg 0.9 [6]
•• Following features of standard libraries are not available:
•• 'io.popen', 'io.pclose', 'io.tmpfile'.
•• 'os.execute', 'os.tmpname', 'os.getenv', 'os.setlocale', 'os.exit'.
•• 'debug' library.
•• All functions and constants from 'math', except 'math.abs', 'math.ceil', 'math.floor', 'math.max', 'math.min' and
'math.random'.
•• 'print'
•• Following changes are made to standard functions:
•• 'pairs' now calls "__pairs" metamethod of it's argument, and falls back to 'rawpairs' call. Original 'pairs' is now
renamed to 'rawpairs'. These changes allow simple way of implementing default iteration behaviour for
objects, by providing "__pairs" metamethod.
•• math.random without arguments can return any 64 bit integer number. All bits of the result are random.
•• "/LIB" is a virtual path that contains additional libraries. This path is not accessible for file operations.
References
[1] http:/ / www. lua. org/
[2] http:/ / lua-users. org/ lists/ lua-l/ 2006-02/ msg00507. html
[3] http:/ / lua-users. org/ wiki/ LuaPowerPatches
[4] http:/ / luaforge. net/ projects/ bitlib
[5] http:/ / www. keplerproject. org/ md5
[6] http:/ / www. inf. puc-rio. br/ ~roberto/ lpeg/ lpeg. html