lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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?