lua-users home
lua-l archive

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


On Sat, May 15, 2010 at 7:53 AM, Henk Boom <henk@henk.ca> wrote:
> This will fail if the new table contains a closure which makes use of the
> global env. I think you need to make the environment a proxy table which
> writes to the new table, and reads from the table followed by the global
> scope (by using a function  for __index).

Thanks, well spotted. The proxy method you describe can also be used
to make internal module environments different from the actual module
table, so you can have the convenience of package.seeall without the
nasty backdoor to the global environment.

steve d.