diff --git a/src/bindings/lua/environment.cpp b/src/bindings/lua/environment.cpp index 097644e5e..dca82ac8c 100644 --- a/src/bindings/lua/environment.cpp +++ b/src/bindings/lua/environment.cpp @@ -250,6 +250,6 @@ void open_environment(lua_State * L) { SET_GLOBAL_FUN(mk_environment, "environment"); SET_GLOBAL_FUN(environment_pred, "is_environment"); SET_GLOBAL_FUN(get_environment, "get_environment"); - SET_GLOBAL_FUN(get_environment, "env"); + SET_GLOBAL_FUN(get_environment, "get_env"); } } diff --git a/tests/lean/lua4.lean b/tests/lean/lua4.lean index d5a0ba7be..36c6baa1e 100644 --- a/tests/lean/lua4.lean +++ b/tests/lean/lua4.lean @@ -4,9 +4,10 @@ Variable x : Int -- Add a variable to the environment using Lua -- The type of the new variable is equal to the type -- of x -typeofx = env():check_type(Const("x")) +local env = get_environment() +typeofx = env:check_type(Const("x")) print("type of x is " .. tostring(typeofx)) -env():add_var("y", typeofx) +env:add_var("y", typeofx) **) Check x + y diff --git a/tests/lean/lua5.lean b/tests/lean/lua5.lean index ae0e18ec8..2277c93a3 100644 --- a/tests/lean/lua5.lean +++ b/tests/lean/lua5.lean @@ -1,11 +1,12 @@ Variable x : Int (** -local N = 100 +local N = 100 +local env = get_environment() -- Create N variables with the same type of x -typeofx = env():check_type(Const("x")) +typeofx = env:check_type(Const("x")) for i = 1, N do - env():add_var("y_" .. i, typeofx) + env:add_var("y_" .. i, typeofx) end **) diff --git a/tests/lean/lua8.lean b/tests/lean/lua8.lean index ac1dd8a53..7bd3c3973 100644 --- a/tests/lean/lua8.lean +++ b/tests/lean/lua8.lean @@ -1,13 +1,14 @@ Variable x : Int (** -ty_x = env():check_type(Const("x")) +local env = get_environment() +ty_x = env:check_type(Const("x")) c = context() c = context(c, "x", ty_x) c = context(c, "y", ty_x) print(c) -o = env():find_object("x") +o = env:find_object("x") print(o) -o = env():find_object("y") +o = env:find_object("y") print(o) **) \ No newline at end of file