Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lua Feature Matrix (5.1 – 5.5)

Cross-version feature reference for the Lua programming language. Each feature shows the version in which it was introduced, and when it was deprecated or removed.

rilua targets Lua 5.1.1 (the version embedded in the World of Warcraft game client). Features from later versions are documented for reference.

Legend

Version columns:

  • ✓ – Available (standard, documented in reference manual)
  • D – Deprecated (per reference manual or available only via compatibility flags)
  • (empty) – Not present (not yet introduced, or removed)

rilua column:

  • ✓ – Fully implemented
  • ~ – Partially implemented (known limitations)
  • ✗ – Not implemented

1. Types and Values

Feature5.15.25.35.45.5riluaNotes
nil
booleanOnly false and nil are falsy
number (float only)All numbers are f64 in 5.1–5.2
number (integer subtype)64-bit integers + 64-bit floats
stringImmutable, 8-bit clean byte sequences
functionFirst-class values
tableAssociative arrays
userdata (full)Arbitrary host data with metatables
userdata (light)Raw pointer, no metatable
threadCoroutine execution context
Reference semanticsTables, functions, threads, userdata
Automatic string-number coercionDDRestricted in 5.4+ (moved to string metamethods)

2. Lexical Elements

Feature5.15.25.35.45.5riluaNotes
21 reserved keywordsand break do else elseif end false for function if in local nil not or repeat return then true until while
22 reserved keywords5.2+ adds goto to the 5.1 set
23 reserved keywords5.5 adds global; effectively 22 when LUA_COMPAT_GLOBAL is on (default)
global keywordConditionally reserved; unreserved by default via LUA_COMPAT_GLOBAL
Short strings ("..." / '...')
Long strings ([[...]])With levels: [=[...]=]
Escape: \a \b \f \n \r \t \v \\ \" \'
Escape: \ddd (decimal byte)
Escape: \xHH (hex byte)5.2 feature
Escape: \z (skip whitespace)5.2 feature
Escape: \u{XXXX} (Unicode)UTF-8 encoding of codepoint
Decimal numeric literals42, 3.14, 1e10
Hexadecimal integer literals0xff
Hexadecimal float literals0x1.Bp10
Line comments (--)
Block comments (--[[...]])
Shebang line (#!)First line only
Empty statement (;)5.1 allows ; as separator only, not as statement

3. Variables and Scope

Feature5.15.25.35.45.5riluaNotes
Global variablesStored in environment table
Local variablesLexically scoped
Upvalues (closures)Inner functions capture outer locals
Function environments (setfenv/getfenv)Replaced by _ENV in 5.2
_ENV variableFree names translated to _ENV.var
_G global table
local x <const>Compile-time constant local
local x <close>Calls __close on scope exit
global declarationsglobal x, global *, global x <const>
Named vararg tablesNamed access to varargs

4. Statements and Control Flow

Feature5.15.25.35.45.5riluaNotes
do ... end blocksExplicit scope
Assignment (single and multiple)x, y = y, x
if ... elseif ... else ... end
while ... do ... endPre-test loop
repeat ... untilPost-test loop; body visible to condition
Numeric forfor i = start, limit, step do
Generic forfor k, v in iterator do
Generic for closing value4th variable: to-be-closed
Read-only for loop variablesControl variable in generic for is read-only
breakMust be last statement in 5.1
break anywhere in block5.1 requires do break end workaround
goto and ::label::Cannot jump into or across local scope
returnWith optional expression list
Function calls as statements

5. Expressions and Operators

5.1 Arithmetic

Feature5.15.25.35.45.5riluaNotes
+ - * / % ^ (unary -)
Floor division //Rounds quotient toward negative infinity

5.2 Bitwise

Feature5.15.25.35.45.5riluaNotes
& (AND)Language-level operator (not bit32 library)
| (OR)
~ (XOR / unary NOT)Binary XOR and unary NOT
<< >> (shifts)

5.3 Relational

Feature5.15.25.35.45.5riluaNotes
== ~= < > <= >=

5.4 Logical

Feature5.15.25.35.45.5riluaNotes
and or notShort-circuit evaluation

5.5 Other

Feature5.15.25.35.45.5riluaNotes
.. (concatenation)
# (length)
Table constructors {}Array, record, mixed
Parenthesized expressionsTruncate multi-return to single value

6. Functions

Feature5.15.25.35.45.5riluaNotes
Named definitionfunction f() end
Local definitionlocal function f() end
Anonymous (lambda)function() end
Method definition (:)Implicit self parameter
Dotted namesfunction a.b.c() end
No-parenthesis callSingle string or table arg
Method call (:)obj:method(args)
Multiple return values
Varargs (...)
Proper tail calls~Known bug with return-from-C
Closures (upvalues)
C/Rust functionsNative host functions
Light C functionsNo allocation overhead

7. Metatables and Metamethods

Feature5.15.25.35.45.5riluaNotes
getmetatable / setmetatable
__index (read)Table or function
__newindex (write)Table or function
__callCall non-function values
__add __sub __mul __div __mod __pow __unmArithmetic metamethods
__idivFloor division metamethod
__band __bor __bxor __bnot __shl __shrBitwise metamethods
__eq5.1-5.2: same type and same metamethod required; 5.3+: checks each operand’s metatable independently
__lt __le
__concat
__len5.2+ honors __len for tables
__tostring
__metatableProtect metatable from access
__mode (weak tables)"k", "v", or "kv"
__gc (userdata finalizer)
__gc (table finalizer)Extended to tables in 5.2
__pairsAdded in 5.2; present in source and manual index through 5.5
__ipairsDAdded in 5.2; deprecated in 5.3 (LUA_COMPAT_IPAIRS), removed in 5.4
__closeFor to-be-closed variables

8. Garbage Collection

Feature5.15.25.35.45.5riluaNotes
Incremental mark-sweepTri-color with write barriers
Generational mode (experimental)Removed in 5.3 as experimental
Generational mode (stable)Re-introduced in 5.4
Incremental major collectionsMajor GC done incrementally in 5.5
collectgarbage("collect")
collectgarbage("stop"/"restart")
collectgarbage("count")5.2 returns 2 values (kbytes, remainder); 5.1 and 5.3+ return single value
collectgarbage("step")
collectgarbage("setpause"/"setstepmul")Replaced by collectgarbage("param") in 5.5
collectgarbage("param")Unified parameter access: ("param", name [, value])
collectgarbage("isrunning")
collectgarbage("incremental")Switch to incremental mode; 5.4+ accepts parameters
collectgarbage("generational")Switch to generational mode; 5.4+ accepts parameters
Weak tables (__mode)
Ephemeron tablesWeak keys with value dependency
Emergency GCRuns GC on allocation failure
Userdata finalizersVia __gc metamethod
Table finalizersExtended __gc to tables
gcinfo()DDeprecated in 5.1; removed in 5.2

9. Coroutines

Feature5.15.25.35.45.5riluaNotes
coroutine.create
coroutine.resume
coroutine.yield
coroutine.wrapReturns iterator function
coroutine.status
coroutine.running5.2+ returns 2 values (thread, is-main)
coroutine.isyieldable
coroutine.closeClose coroutine and its to-be-closed vars
Yieldable pcall/xpcallCoroutines can yield across protected calls
Yieldable metamethods

10. Error Handling

Feature5.15.25.35.45.5riluaNotes
error(msg [, level])
pcall(f, ...)
xpcall(f, msgh)5.1 signature: 2 args only
xpcall(f, msgh, ...)5.2+ passes extra args to f
Error objects (any value)
warn(msg)Non-fatal warning system

11. Standard Library: Base Functions

Feature5.15.25.35.45.5riluaNotes
assert
collectgarbageOptions vary by version
dofile
error
getmetatable
ipairs5.3+ uses lua_geti (respects __index); 5.2 __ipairs metamethod separate
load5.2+ accepts string and mode/env args
loadfile5.2+ accepts mode/env args
next
pairs
pcall
print5.4+ calls __tostring directly
rawequal
rawget
rawset
rawlenLength without __len
select
setmetatable
tonumber
tostring
type
xpcallSignature changed in 5.2 (see sec. 10)
_G
_VERSION"Lua 5.x"
warnNon-fatal warnings
unpack (global)DDMoved to table.unpack in 5.2; 5.3 via LUA_COMPAT_UNPACK
loadstringDDUse load in 5.2+; 5.3 via LUA_COMPAT_LOADSTRING
getfenvRemoved in 5.2 (replaced by _ENV)
setfenvRemoved in 5.2 (replaced by _ENV)
moduleDDDeprecated in 5.2; 5.3 via LUA_COMPAT_MODULE
newproxyUndocumented in 5.1; removed in 5.2
gcinfoDDeprecated since 5.0; removed in 5.2

12. Standard Library: String

Feature5.15.25.35.45.5riluaNotes
string.byte
string.char
string.dump5.3+ adds strip parameter
string.find
string.format5.2+: %s calls __tostring via luaL_tolstring; 5.4+: %p specifier
string.gmatch5.4+ adds optional init parameter
string.gsub
string.len
string.lower
string.match
string.rep5.2+ adds optional sep parameter
string.reverse
string.sub
string.upper
string.packBinary data packing
string.unpackBinary data unpacking
string.packsizePacked size calculation
string.gfindDDeprecated alias for gmatch; removed in 5.2
String metatable (__index)Method syntax: s:upper()
Frontier pattern (%f)Implemented in 5.1 (undocumented); documented in 5.2
Pattern class %gPrintable characters (except space)
\0 in patternsNull bytes in patterns

13. Standard Library: Table

Feature5.15.25.35.45.5riluaNotes
table.concat
table.insert5.2+ stricter argument checking
table.remove5.2+ stricter argument checking
table.sort
table.unpackReplaces global unpack from 5.1
table.packReturns table with .n field
table.moveMove elements between positions/tables
table.createPre-allocate table with size hints
table.maxnDDLargest positive numeric key; 5.3 via LUA_COMPAT_MAXN
table.foreachDDeprecated since 5.0
table.foreachiDDeprecated since 5.0
table.getnDUse # operator instead
table.setnDNo replacement; removed in 5.2

14. Standard Library: Math

Feature5.15.25.35.45.5riluaNotes
math.abs
math.acos
math.asin
math.atan5.3+ accepts 2 args (replaces atan2)
math.ceil
math.cos
math.deg
math.exp
math.floor
math.fmod
math.log5.2+ adds optional base parameter
math.max
math.min
math.modf
math.rad
math.random5.4 switches to xoshiro256** RNG
math.randomseed
math.sin
math.sqrt
math.tan
math.hugePositive infinity
math.pi
math.maxintegerLargest integer value
math.minintegerSmallest integer value
math.tointegerConvert float to integer if fits
math.type"integer", "float", or false
math.ultUnsigned integer less-than comparison
math.atan2DDDUse math.atan(y, x) in 5.3+; 5.3+ via LUA_COMPAT_MATHLIB
math.coshDDD5.3+ via LUA_COMPAT_MATHLIB
math.sinhDDD5.3+ via LUA_COMPAT_MATHLIB
math.tanhDDD5.3+ via LUA_COMPAT_MATHLIB
math.powDDDUse x ^ y operator; 5.3+ via LUA_COMPAT_MATHLIB
math.frexpDDRestored as standard in 5.5; 5.3-5.4 via LUA_COMPAT_MATHLIB
math.ldexpDDRestored as standard in 5.5; 5.3-5.4 via LUA_COMPAT_MATHLIB
math.log10DDDDUse math.log(x, 10); 5.3+ via LUA_COMPAT_MATHLIB
math.modDAlias for fmod; deprecated since 5.0

15. Standard Library: I/O

Feature5.15.25.35.45.5riluaNotes
io.close
io.flush
io.input
io.lines5.2+ accepts read format options
io.open
io.output
io.popen
io.read5.2+ adds "*L" format (line with newline)
io.tmpfile
io.type
io.write
io.stdin / io.stdout / io.stderr
file:close5.2+: pipe close returns exit status
file:flush
file:lines5.2+ accepts format options
file:read
file:seek
file:setvbuf
file:write5.2+: returns file handle (for chaining)

16. Standard Library: OS

Feature5.15.25.35.45.5riluaNotes
os.clock
os.date
os.difftime
os.execute5.2+ returns true/nil, reason, code
os.exit5.2+ adds optional close parameter
os.getenv
os.remove
os.rename
os.setlocale
os.time
os.tmpname

17. Standard Library: Debug

Feature5.15.25.35.45.5riluaNotes
debug.debug~Stub
debug.gethookReturns hook function, mask string, count
debug.getinfo5.2+ adds nparams, isvararg, istailcall
debug.getlocal5.2+ accesses vararg info
debug.getmetatable
debug.getregistry
debug.getupvalue
debug.sethookLine, call, return, and count hooks
debug.setlocal
debug.setmetatable
debug.setupvalue
debug.traceback
debug.upvalueidUnique ID for upvalue
debug.upvaluejoinMake upvalues share
debug.getuservalue5.4+ supports multiple user values
debug.setuservalue5.4+ supports multiple user values
debug.setcstacklimitAdded in 5.4; removed in 5.5
debug.getfenvRemoved with environment model in 5.2
debug.setfenvRemoved with environment model in 5.2

18. Standard Library: Package

Feature5.15.25.35.45.5riluaNotes
require
package.config
package.cpath
package.loaded
package.loadlib~Loads rilua-native modules (not PUC-Rio C modules); requires dynmod feature
package.path
package.preload
package.searchpath
package.searchersReplaces package.loaders
package.loadersDDRenamed to package.searchers in 5.2; 5.3 via LUA_COMPAT_LOADERS
package.seeallDDDeprecated in 5.2; 5.3 via LUA_COMPAT_MODULE
moduleDDDeprecated in 5.2; 5.3 via LUA_COMPAT_MODULE

19. Standard Library: bit32

Feature5.15.25.35.45.5riluaNotes
bit32.arshiftDArithmetic right shift
bit32.bandDBitwise AND
bit32.bnotDBitwise NOT
bit32.borDBitwise OR
bit32.btestDTest bits
bit32.bxorDBitwise XOR
bit32.extractDExtract bits
bit32.replaceDReplace bits
bit32.lrotateDLeft rotate
bit32.lshiftDLeft shift
bit32.rrotateDRight rotate
bit32.rshiftDRight shift

20. Standard Library: UTF-8

Feature5.15.25.35.45.5riluaNotes
utf8.charCreate UTF-8 string from codepoints
utf8.charpatternPattern matching one UTF-8 character
utf8.codesIterator over codepoints
utf8.codepointGet codepoints from string
utf8.lenCount UTF-8 characters
utf8.offset5.5: also returns final position

21. rilua: Interpreter CLI

Reproduces the PUC-Rio Lua 5.1.1 standalone interpreter (lua.c).

Feature5.15.25.35.45.5riluaNotes
rilua [options] [script [args]]
Option -e statExecute string
Option -iInteractive mode after script
Option -l nameRequire library
Option -vVersion info
Option --Stop option handling
Option -Execute stdin
Option -EIgnore environment variables
Option -WTurn on warnings
LUA_INIT env varExecute string or @filename
arg tablearg[0] is script name
REPL / interactive mode_PROMPT / _PROMPT2 globals
REPL =expr shorthandCalculator mode added in 5.3 alongside; =expr removed in 5.5

22. rilua: Bytecode Compiler CLI

Reproduces the PUC-Rio luac bytecode compiler/lister.

Feature5.15.25.35.45.5riluaNotes
riluac [options] [files]
Option -lList bytecode
Option -l -lList with constants and locals
Option -pParse only (syntax check)
Option -o fileWrite binary output
Option -sStrip debug info
Option -vVersion info

23. rilua: Rust Embedding API

These features are rilua-specific (not part of the Lua language standard) but correspond to the C API provided by PUC-Rio Lua.

FeatureriluaNotes
Lua struct (state ownership)Main VM state
IntoLua / FromLua traitsType-safe value conversion
Table handleRead/write table fields
Function handleCall Lua functions from Rust
Thread handleCoroutine manipulation
AnyUserData handleTyped Rust data in Lua
StdLib bitflagsSelective library loading
LuaResult<T> error handlingResult-based (no longjmp)
Lua::load() / Lua::load_bytes()Load and compile chunks
Lua::gc_collect() etc.GC control from Rust
Registry tableGlobal storage for host

Version Evolution Summary

Lua 5.1 (2006) – rilua target

The baseline. All numbers are f64. Function environments via setfenv/getfenv. Module system via module() and package.loaders. Pattern matching (not regex). Incremental GC. Coroutines. 21 keywords.

Lua 5.2 (2011)

Replaced function environments with _ENV lexical scoping. Added goto/labels, bit32 library, table.pack/table.unpack, rawlen, yieldable pcall/xpcall, ephemeron tables, table finalizers (__gc), hex string escapes, hexadecimal floats, package.searchpath. Documented frontier patterns (%f, already implemented in 5.1). Removed setfenv/getfenv, newproxy. Deprecated module, loadstring, global unpack, table.maxn, math.log10.

Lua 5.3 (2015)

Added 64-bit integer subtype alongside floats. Introduced native bitwise operators (&, |, ~, <<, >>), floor division (//), utf8 library, string.pack/unpack/packsize, table.move, math.tointeger/math.type/math.maxinteger/math.mininteger, coroutine.isyieldable, math.ult, \u{XXXX} string escapes, string.dump strip parameter. Changed ipairs to use lua_geti (respects __index metamethods). Deprecated bit32 library, math.atan2, math.cosh/sinh/tanh, math.pow, math.frexp/ldexp, math.log10. Deprecated __ipairs metamethod. Removed experimental generational GC.

Lua 5.4 (2020)

Added to-be-closed variables (<close>), const locals (<const>), generic for closing value (4th variable), stable generational GC, warn() function and -W CLI flag, coroutine.close, __close metamethod, string.gmatch init parameter, string.format %p, xoshiro256** RNG, debug.setcstacklimit, multiple user values for userdata. Relaxed __eq to check each operand’s metatable independently (no longer requires same metamethod). Removed bit32 library and __ipairs metamethod. Deprecated math functions (atan2, cosh, sinh, tanh, pow, frexp, ldexp, log10) remain behind LUA_COMPAT_MATHLIB (under LUA_COMPAT_5_3). Restricted implicit string-to-number coercion (moved to string metatable metamethods).

Lua 5.5 (2025)

Added global keyword for explicit global declarations, named vararg tables, read-only for-loop variables, table.create, incremental major GC collections, compact arrays (60% less memory for large arrays), decimal float printing, collectgarbage("param") unified parameter API. Enhanced utf8.offset to return final position. Restored math.frexp and math.ldexp as standard functions (no longer behind compat flag). Removed debug.setcstacklimit, =expr REPL shorthand, collectgarbage("setpause"/"setstepmul").


Corrections from Previous Versions

This matrix corrects version attributions found during verification against the Lua reference manuals and PUC-Rio source code.

Round 1 corrections (version attribution errors)

  • Bitwise operators (&, |, ~, <<, >>) are language-level features added in 5.3, not 5.2. The bit32 library (a function library, not operators) was added in 5.2.
  • rawlen was added in 5.2, not 5.3.
  • table.move was added in 5.3, not 5.2.
  • coroutine.isyieldable was added in 5.3, not 5.2.
  • \xHH and \z string escapes were added in 5.2, not 5.1.
  • Empty statement (; as a statement) was added in 5.2. In 5.1, ; is only a statement separator.
  • math.log10 was deprecated in 5.2 (with math.log(x, 10) as replacement), not 5.3.

Round 2 corrections (manual/source verification)

  • Frontier pattern %f: Was already implemented in 5.1.1 source code (lstrlib.c lines 383–393) but undocumented. 5.2 officially documented it. The Lua 5.2 readme lists “frontier patterns” but this refers to documentation, not new code. rilua implements %f.
  • __pairs metamethod: Was not removed in 5.3. It remained functional through 5.3 (previously corrected from “removed in 5.3” to “removed in 5.4”; see Round 3 for further correction).
  • __ipairs metamethod: Was deprecated (not removed) in 5.3. The 5.3 manual says “its __ipairs metamethod has been deprecated.” It was removed in 5.4.
  • =expr REPL shorthand: Was not removed in 5.3. Calculator mode (addreturn) was added in 5.3, but =expr coexisted through 5.4 with a “for compatibility with 5.2” comment. =expr was finally removed in 5.5.

Round 3 corrections (source code and rilua verification)

  • \xHH and \z escape sequences: rilua column was ✓ but should be . The rilua lexer (scan_short_string) only handles 5.1 escapes (\a \b \f \n \r \t \v \\ \" \' \<newline> \ddd). Previous note “rilua includes as extension” was incorrect.
  • table.unpack: rilua column was ✓ but should be . rilua only registers the global unpack (5.1 standard). table.unpack is a 5.2+ feature not present in the table library.
  • __pairs metamethod: Was never removed from PUC-Rio source or manual index. lbaselib.c:luaB_pairs unconditionally checks __pairs in 5.2, 5.3, 5.4, and 5.5. Corrected from “removed in 5.4” to ✓ in all versions 5.2 through 5.5.
  • string.format %s and __tostring: Started in 5.2 (when luaL_tolstring was introduced), not 5.3. The 5.1 lstrlib.c uses luaL_checklstring (no metamethod); 5.2+ uses luaL_tolstring.
  • Reserved keyword count: 5.1 has 21 keywords. 5.2+ has 22 (adds goto). Split into separate rows to avoid implying 5.2+ also has 21.
  • Math compat functions (atan2, cosh, sinh, tanh, pow, frexp, ldexp, log10): Available in 5.4 behind LUA_COMPAT_MATHLIB (via LUA_COMPAT_5_3). Marked D instead of empty.
  • math.frexp and math.ldexp: Restored as standard functions in 5.5 (always available, not behind any compat flag). Marked ✓ in 5.5.
  • global keyword: Conditionally reserved in 5.5. Unreserved by default when LUA_COMPAT_GLOBAL is defined (which it is by default).
  • __eq note: Removed “5.2+ requires same type and same metamethod” – this restriction applies to all versions including 5.1. The 5.1 source (get_compTM) already requires both operands to share the same metamethod function.
  • collectgarbage("count") note: Clarified that 5.2 is the outlier returning 2 values (kbytes + remainder). Both 5.1 and 5.3+ return a single combined value.
  • table.insert/table.remove stricter checking: Changed “5.3+” to “5.2+”. Position bounds validation via luaL_argcheck was introduced in 5.2, not 5.3.

Round 4 Corrections

  • debug.setcstacklimit: Changed 5.5 from ✓ to empty. This function was added in 5.4 but removed in 5.5 (not present in 5.5 dblib[]).
  • package.loaders: Changed 5.3 from empty to D. Available in 5.3 via LUA_COMPAT_LOADERS (under LUA_COMPAT_5_1).
  • module and package.seeall: Changed 5.3 from empty to D. Available in 5.3 via LUA_COMPAT_MODULE (under LUA_COMPAT_5_1).
  • Version Evolution Summary (5.4): Changed “Removed __pairs/__ipairs metamethods” to “Removed __ipairs metamethod”. The __pairs metamethod was never removed (present unconditionally in lbaselib.c through 5.5).
  • Version Evolution Summary (5.4): Changed “Removed … deprecated math functions” to “Moved … behind LUA_COMPAT_MATHLIB”. The table data correctly shows D (not empty) for these functions in 5.4, so “Removed” was contradictory.

Round 5 Corrections

  • xpcall(f, msgh, ...): Changed rilua column from ✓ to ✗. The rilua implementation matches the 5.1 signature (2 args only); extra arguments are not forwarded to f (state.top = func_pos + 1 in base.rs).
  • Legend: Refined D definition from “available via compatibility flags, not recommended” to “per reference manual or available only via compatibility flags”. In 5.1, functions like gcinfo, table.foreach, table.foreachi, table.getn are deprecated per the reference manual but unconditionally registered (no compat flag). The original wording only described the later-version compat-flag pattern.

Round 6 Corrections

  • collectgarbage("incremental"): Added ✓ for 5.2. Present in opts[] as LUA_GCINC (value 11) for switching from generational to incremental mode. Removed in 5.3 (with experimental generational GC), re-added in 5.4.
  • collectgarbage("generational"): Added ✓ for 5.2. Present in opts[] as LUA_GCGEN (value 10). Same lifecycle as "incremental".
  • module (section 11): Changed 5.3 from empty to D for consistency with section 18 (which was already corrected in Round 4). Available in 5.3 via LUA_COMPAT_MODULE under LUA_COMPAT_5_1.

Round 7 Corrections (Lua 5.3 focused)

  • unpack (global): Changed 5.3 from empty to D. Available in 5.3 via LUA_COMPAT_UNPACK (under LUA_COMPAT_5_1).
  • loadstring: Changed 5.3 from empty to D. Available in 5.3 via LUA_COMPAT_LOADSTRING (under LUA_COMPAT_5_1).
  • table.maxn: Changed 5.3 from empty to D. Available in 5.3 via LUA_COMPAT_MAXN (under LUA_COMPAT_5_2).
  • Math compat function notes: Changed “5.4-5.5 via LUA_COMPAT_MATHLIB” to “5.3+ via LUA_COMPAT_MATHLIB” for math.atan2, math.cosh, math.sinh, math.tanh, math.pow, math.log10. The flag exists in 5.3 under LUA_COMPAT_5_2, same mechanism as 5.4’s LUA_COMPAT_5_3.
  • math.frexp/math.ldexp notes: Changed “5.4 via LUA_COMPAT_MATHLIB” to “5.3-5.4 via LUA_COMPAT_MATHLIB”. Same compat mechanism applies in 5.3.
  • ipairs note: Changed “5.3+ respects metamethods” to clarify it uses lua_geti (which respects __index), distinct from the 5.2 __ipairs metamethod.
  • Added math.ult row: New in 5.3 (unsigned integer less-than). Present unconditionally in mathlib[] in 5.3+.
  • 5.3 version summary: Added math.ult, string.dump strip parameter, ipairs metamethod behavioral change, and math.log10 deprecation.

Round 8 Corrections (Lua 5.4 focused)

  • __eq note: Changed “Same type and same metamethod required (all versions)” to distinguish 5.1-5.2 behavior (requires same metamethod via get_compTM) from 5.3+ behavior (checks each operand’s metatable independently via luaT_gettmbyobj).
  • 5.4 version summary: Added math.log10 to the list of deprecated math functions behind LUA_COMPAT_MATHLIB (was omitted while the other 7 functions were listed). Added debug.setcstacklimit, multiple user values for userdata, generic for closing value, -W CLI flag, and __eq relaxation. Reworded “Moved … behind LUA_COMPAT_MATHLIB” to “remain behind LUA_COMPAT_MATHLIB (under LUA_COMPAT_5_3)” since these were already behind the flag in 5.3.

Round 9 Corrections (Lua 5.5 focused)

  • collectgarbage("setpause"/"setstepmul"): Changed 5.5 from ✓ to empty. These options were removed in 5.5, replaced by the unified collectgarbage("param", name [, value]) API (LUA_GCPARAM). The opts[] array in 5.5’s lbaselib.c no longer contains "setpause" or "setstepmul".
  • Added collectgarbage("param") row: New in 5.5 only. Provides unified get/set for GC parameters: "pause", "stepmul", "stepsize", "minormul", "majorminor", "minormajor".
  • Reserved keyword count for 5.5: Changed “22 reserved keywords” from ✓ to empty for 5.5. Added new “23 reserved keywords” row for 5.5. The 5.5 llex.h enum lists 23 reserved words (including global); LUA_COMPAT_GLOBAL (on by default) unreserves global, making the effective count 22, but the manual lists 23.
  • 5.5 version summary: Added restorations (math.frexp/math.ldexp), removals (debug.setcstacklimit, =expr REPL shorthand, collectgarbage("setpause"/"setstepmul")), and the new collectgarbage("param") API.