lua-users home
lua-l archive

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


On Wed, Apr 10, 2013 at 12:07 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
Forgetting to return the module table is like forgetting to take your
cash out of the automatic teller machine: it's a waste, but you'll
discover pretty soon you haven't got it.

Hah, too true!  This strikes me as another check for a Lua 'lint' tool that turns silly mistakes into compile errors.  Otherwise we're just cheerfully accepting 'backtrace-driven programming' as someone recently said about Python.

Messing around with package.loaded qualifies as obfuscated code.

Not if we put into a well-documented module. It just uses some insider knowledge about how require() works. And so a plain dofile() won't work as expected, which is a gotcha