dellingr 0.1.0

An embeddable, pure-Rust Lua VM with precise instruction-cost accounting
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Test local function syntax

local function add(a, b)
    return a + b
end

print(add(2, 3))

-- Test recursion (the main reason for local function)
local function fib(n)
    if n < 2 then return n end
    return fib(n-1) + fib(n-2)
end

print(fib(10))