luna-core 2.13.0

Pure-Rust Lua runtime (interpreter only, zero third-party dependencies). The JIT-equipped variant lives in the `luna-jit` crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
-- v2.13 CORPUS-IV: __eq — consulted only when both operands are
-- tables (or both userdata); primitive comparisons never consult.
local mt = { __eq = function(a, b) return true end }
local a = setmetatable({}, mt)
local b = setmetatable({}, mt)
local c = {}
print(a == b)      -- true via __eq
print(a == c)      -- true: 5.3+ consults if either has __eq
print(a == a)      -- true: identity short-circuits
print(a == 1, a == "x", a == nil)  -- false: type mismatch, no consult
print(1 == 1.0)    -- true: numeric, no metamethod