luna-core 2.12.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
12
13
-- v2.11 CORPUS-II: short-circuit evaluation with side effects.
-- (An and/or chain is an expression, not a statement — bind it.)
local order = {}
local function tag(name, v)
  order[#order+1] = name
  return v
end
local r1 = tag("a", true) and tag("b", false) or tag("c", "res")
print(r1, table.concat(order, ","))    -- res  a,b,c

order = {}
local r2 = tag("x", false) and tag("y", true) or tag("z", "res")
print(r2, table.concat(order, ","))    -- res  x,z (y skipped)