lua-users home
lua-l archive

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


On Thu, Nov 27, 2008 at 5:55 AM, Geoff Richards <Ni1phahs@ungwe.org> wrote:
Could you just preload the module by calling 'require' yourself
before 'loadfile'?  That would give you the chance to update whatever
table the module returns or globals it creates.  Lua's module caching
will prevent the module's initialization stuff being run again after
you've fiddled with it.

Yes and that is what I am doing right now, but I am trying to make this a generic app that has a limited list of dependencies. This way not everybody will have to have the module to use this application. It is distributed with an application at work. It is a good function though so I like the name and it will fix perfectly into the way the application is written.

Other thoughts?

Can I force the overwrite to happen after 'loadfile()' is called?
--
Regards,
Ryan