[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: require versus straight call..
- From: Duck <duck@...>
- Date: Mon, 17 Mar 2008 14:44:49 +1100 (EST)
If I use:
module(...,whatever)
correctly at the top of any packages I might create, does:
loadfile(modulename ..'.lua')(modulename)
become equivalent in side-effects to calling:
require(modulename)
?
In other words, can I simulate a require-style loader directly with
loadfile, and have the correct side-effects to _G, package.loaded, and so
forth? And if so, could I do this:
loadstring(modulecode)(modulename)
as well?