lua-users home
lua-l archive

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


On Sun, Oct 16, 2011 at 3:40 AM, David Manura <dm.lua@math2.org> wrote:
> I believe it's preferred to utilize package.preload rather than
> override require.

I've been trying to insert package.preloade[<modulename>] = <etc> in
different ways, but it did not quite work for me.

So far my version with require(), which is only __locally__
overridden, appears to work a tiny wee bit more flawless than you
suggest. :-P

Anyway, I did remove my require() hook[1], and instead, inserted the
modules directly into `package.loaded`. It'll still honor the local
namespace, though. Who could possibly know why package.preload doesn't
work? :-P

[1] https://github.com/beelzebub/mergelua/blob/master/merge.lua#L114