From db523926d3ec9ceddc7eaa4e0d72ec72f41fb7e7 Mon Sep 17 00:00:00 2001 From: nymphium Date: Thu, 13 Aug 2015 18:06:03 +0900 Subject: [PATCH] make it choice /usr/bin/lua, not lua5.1 --- Makefile | 4 ++-- moon/init.moon | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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