|
...
include = require
function require(modulename)
local before_ENV = table.clone(_ENV)
include(modulename)
prepend_functions(_ENV, before_ENV)
end
This lets me just call require("module1") and it will automagically
chain together any functions that get redefined.
Anyone see any flaws with this approach/with the code?
Thanks,
Mike
(I'm only starting to learn lua, but I am getting the impression that
"ugly hack" and "cool feature" are the same thing in lua? lol)