big refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-21 14:10:48 +02:00
parent ba61cb2f65
commit 2b9a63fe8c
2 changed files with 33 additions and 42 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
local aux_module, getn, setn, tinsert, tremove, getfenv, setfenv, gfind = aux_module, getn, table.setn, tinsert, tremove, getfenv, setfenv, string.gfind
local aux_module, getn, setn, tinsert, tremove, setfenv = aux_module, getn, table.setn, tinsert, tremove, setfenv
aux = aux_module 'core'
public.version = '5.0.0'
@@ -25,9 +25,8 @@ end
do
local modules = {}
local function module_env(name) aux_module(name) return m end
function public.module(name)
local env = module_env(name)
local env = aux_module(name).env
if not modules[name] then env.import(temp-{['']='modules', ['']='core', ['']='util'}) end
setfenv(2, env)
modules[name] = true