lua-users home
lua-l archive

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


>> But require() should be the one that sets the global (if it must) and
>> return the module (I prefer this) into the caller's environment.
>
> I had come to the same conclusion: The policy of how a module is
> imported should be caller's decision (require), not hard-coded into
> the module definition (module).

But doesn't the definition of a module go beyond the idea of an
importable namespace? Eg., you can have a module that just adds
methods to a class defined in another module, or a module that changes
the semantics of the language, like strict.lua, etc.