[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1->5.2 and module/require/getfenv issue
- From: Cosmin Apreutesei <cosmin.apreutesei@...>
- Date: Sun, 10 Jan 2010 01:12:46 +0200
>> 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.