lua-users home
lua-l archive

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


On Aug 2, 2010, at 2:36 PM, Roberto Ierusalimschy wrote:

> Now the "usual practice" seems so simple that it does not
> deserve a helper function. Just write this:
> 
>   _ENV = {}
>   ...
>   return _ENV

Hmmm... perhaps I'm missing something very obvious, but how does one name a module in such a setup?

E.g. given a file [1] with the following statements, which define multiple modules:

module( 'URLPath' )
...
module( 'URLParameter' )
...
module( 'URL' )
...

Or, conversely, a module defined across multi files [2][3].

Or one concatenated file containing multiple modules [4].

Either way, removing the module function will lead to a net loss of functionality. Considering that the goal of require/module was to provide a standard way to, well, load and define modules, this seems to be a step backward, pre-5.1 :/


[1] http://dev.alt.textdrive.com/browser/HTTP/URL.lua
[2] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua
[3] http://dev.alt.textdrive.com/browser/HTTP/HTTPExtra.lua 
[4] http://dev.alt.textdrive.com/browser/HTTP/Makefile