lua-users home
lua-l archive

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


Andre Carregal wrote:
> In fact, if there is one thing I'd like to see in Lua 5.2 that would
> be a better way to handle the module finding part of require(). Tools
> that want to intercept require() calls have to repeat a lot of work
> today and any improvements on this front would be welcome.   

What kind of require() interception does require so much code ? Can you
give us an example of 'interceptor' code you would like to be able to
write in an hypothetically ideal module system ?

You can find an example of a module loader that reimplements the normal
Lua modules loader in pure Lua on the wiki [1]. It's just 22 lines long
(is that a lot ?). Rewriting require in pure Lua to better suit your
needs wouldn't be more complicated.

[1] http://lua-users.org/wiki/LuaModulesLoader