diff --git a/Makefile b/Makefile index a374fb3..c620a2e 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,9 @@ global: sudo luarocks make moonscript-dev-1.rockspec compile: - lua5.1 bin/moonc moon/ moonscript/ + lua bin/moonc moon/ moonscript/ echo "#!/usr/bin/env lua" > bin/moon - lua5.1 bin/moonc -p bin/moon.moon >> bin/moon + lua bin/moonc -p bin/moon.moon >> bin/moon echo "-- vim: set filetype=lua:" >> bin/moon watch: diff --git a/moon/init.moon b/moon/init.moon index ef07bba..5817bc5 100644 --- a/moon/init.moon +++ b/moon/init.moon @@ -41,7 +41,7 @@ debug = setmetatable { -- run a function with scope injected before its function environment run_with_scope = (fn, scope, ...) -> - old_env = getfenv fn + old_env = util.getfenv fn env = setmetatable {}, { __index: (name) => val = scope[name] @@ -50,7 +50,7 @@ run_with_scope = (fn, scope, ...) -> else old_env[name] } - setfenv fn, env + util.setfenv fn, env fn ... -- wrap obj such that calls to methods do not need a reference to self