lua-users home
lua-l archive

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

For the moment, if some particular Lua users replace "module" with a
custom version more adapted to its environment (for example in some
project I'd like "module" not to set the global tables, only register
the module in package.loaded), Lua modules will still work with that
environment, but binary modules may fail to. Calling "module" will
ensure that the code provided by the user get called, the code necessary
to adapt the module to the new environment "from the inside".

I've been meaning to ask this for some time, but there are a number of
concerns on the 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?