lua-users home
lua-l archive

Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor]

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


On Tue, Feb 19, 2013 at 10:43 AM, Kevin Martin <kev82@khn.org.uk> wrote:
> I believe this was pretty much my solution, except I used package.preload in
> init.lua to define the module table instead of a separate file.
Yes, this effectively does this using the require() mechanism. More
easy to explain the magic later.
> Is that necessarily a good idea?
Well, nowadays people expect require() to return something other than
'true', and may get a wee bit confused. Some documentation and
examples should remedy that, however.
steve d.

AltStyle によって変換されたページ (->オリジナル) /