lua-users home
lua-l archive

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


> Roberto Ierusalimschy wrote:
> > Modules can be written as "in module(...) do <body> end", with the
> > module function returning the module table.
> 
> Does this mean module() will no longer change the environment of
> its caller? If yes, this means *all* existing Lua source code
> using the module() function will break.

It will still change the environment of its caller, but for
compatibility only. This will be a documented compatibility behavior,
because it affects new code. (Outside the "in module() do ... end" you
will still be inside the module...)

-- Roberto