[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor]
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 19 Feb 2013 10:53:51 +0200
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.
- References:
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], Gavin Kistner
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], Petite Abeille
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], Gavin Kistner
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], steve donovan
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], Gavin Kistner
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], steve donovan
- Re: local "module" pattern without module [was Re: [ANN] SLAXML - pure Lua, robust-ish, SAX-like streaming XML processor], Kevin Martin