lua-users home
lua-l archive

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

> So, _ENV is visible to the end-user? Also it is a "special" variable
> (as opposed to _G, which is just good old global).
> I'm not sure I like this. Special variables are evil, and I can't
> control them by overriding  a couple of functions (or removing them
> from the sandbox).

The *variable* _ENV is not special in any way. The *name* _ENV is
special only to the compiler, as this is the name it uses to name
the added upvalue to the chunk and to prefix global names. In
particular, as already pointed out, anything you can do with _ENV
you can do without it, so I do not see why the need to control it.

-- Roberto