lean2/tests/lua/st1.lua
Leonardo de Moura 95785c7aaa feat(lua): add State objects, it allows us to create several Lua State objects in a lua script
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-11 15:05:50 -08:00

21 lines
389 B
Lua

f = Const("f")
a = Const("a")
t = f(a)
s = State()
s:dostring("x = 10")
t1, t2, t3 =
s:dostring([[
a, b = ...
print("x = " .. tostring(x))
print("a = " .. tostring(a))
print("b = " .. tostring(b))
g = Const("g")
return g(b), g(g(b)), g(b, b)
]], 10, t)
print("t1: " .. tostring(t1))
print("t2: " .. tostring(t2))
print("t3: " .. tostring(t3))
print(x)
print(a)
s:dostring([[ print(b) ]])