lua-users home
lua-l archive

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


Matt Campbell writes:
> Why does one have to pass package.seeall to module() to give a module 
> implicit access to the global table?

package.seeall is not required to access the global table, nor even to access it
implicitly, and I recommend not using package.seeall, but it is one way of doing
so for reasons described in Chapter 15 "Modules and Packages" in "Programming in
Lua, 2nd Ed" (an except of Chapter 15 is online:
http://www.inf.puc-rio.br/~roberto/pil2/ ).

> Is use of package.seeall 
> discouraged?  Or was this done to simplify the implementation?

Here's one opinion on the subject:

  http://lua-users.org/wiki/LuaModuleFunctionCritiqued