lua-users home
lua-l archive

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


* Mark Hamburg:

> The simple fix is to change the module function so that it doesn't
> set any globals but rather just populates a registry of loaded
> modules. That way, in your example, all that require "lpeg" would do
> is:

What would you suggest for nested modules?  Return the top-most module
along the path?  But that might contain other non-imported modules.

> If you want to re-export lpeg from within your module, you are free
> to do so, but it doesn't seem like something you would ordinarily
> want to do.

Yes, that part is fine.

> This does make require a bit more cumbersome in interactive mode,
> however.

There could be a shortcut similar to the "= expression".