Lua Version Compatibility |
|
Op) come with different built-in bit libraries, which are compatible to only some extent (e.g. signedness/overflow). Lua Bit
Op can be installed on 5.2, and see also [bit32 for Lua 5.1?]. [lua-bit-numberlua] provides a bit library with Lua 5.2 "bit32" and Lua
Bit
Op "bit" compatibility interfaces.
load
, loadfile
, getfenv
, and setfenv
for use in 5.1 and 5.2
_ENV
in Lua 5.1.
_VERSION
contains the Lua version string (e.g. "Lua 5.1" [2] or "Lua 5.2" [3]. (Note: LuaJit 2.0-beta reports the Lua version as 5.1.) LuaFiveTwo contains new library functions: [lua_version] and [luaL_checkversion]. In C code, lua.h of Lua 5.1 contains these defines:
#define LUA_VERSION "Lua 5.1" #define LUA_RELEASE "Lua 5.1.4" #define LUA_VERSION_NUM 501
_VERSION == "Lua 5.2"
will almost certainly break in 5.3. _VERSION ~= "Lua 5.1"
will more likely be forward compatible, though will break in 5.0 (if that matters).