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.11 CORPUS-II: __call chain.
local M = {}
M.__call = function(self, ...) return self.wrapped(...) end
local function wrap(f) return setmetatable({wrapped = f}, M) end
local sum = wrap(function(a, b) return a + b end)
print(sum(3, 4))
print(sum(10, 20))

-- nested
local double_sum = wrap(function(a, b) return sum(a, b) * 2 end)
print(double_sum(3, 4))