lua-users home
lua-l archive

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


On Oct 16, 2011, at 9:02 PM, Dirk Laurie wrote:

> return mymod1, mymod2
> What's wrong with that?

If it works for you, nothing wrong. To each their own.

Otherwise, 2 main things:

(1) Return at the end. This presumes one module per Lua chunk. You cannot seamlessly bundle your code.

( (1.1) Parenthetically: the second module will be ignored in your return statement. )

(2) Access to global environment. Your module is not self-contained and may access and set anything in _G. This might or might not be a bug, depending how you look at it.