lua-users home
lua-l archive

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


> I've been meaning to ask this for some time, but there are a number of
> concerns on the http://lua-users.org/wiki/LuaDesignPatterns page,
> namely the pollution of the global namespace by the module system, and
> the package.seeall flag which gives us the odd effect:
> 
> local someModule = require("someModule")
> local one = someModule.math.floor(1.4)
> 
> Is there any chance of these being made a bit more friendly, perhaps
> not setting the globals unless specified somewhere?

I don't think so. As far as I know, the "pollution" of the global
namespace by one name per module is quite theoretical. The problem
created by 'seeall' is trivially fixed by not using 'seeall'. At the
same time, both global names and 'seeall' modules are quite convenient
for a "more relaxed" programming approach.

-- Roberto