[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: a new proposal for environments
- From: Alexander Gladysh <agladysh@...>
- Date: Thu, 25 Feb 2010 12:06:54 +0300
> At the same time, we are convinced that there are situations where
> those functions may be quite useful. To reconcile both views, we are
> reviewing our position that the debug library should be used only for
> debuging (as has already been suggested by some). The debug library
> still should be used with great care and parsimony, but it is a valid
> tool for metaprogramming (e.g., sandboxing) and other needs.
Perhaps it would be better to separate the two needs? Say, debug.* for
debugging, meta.* for metaprogramming. Not sure if it is possible
though...
> We also came up with a new concept for environments in Lua 5.2; its
> main merit is simplicity.
<...>
Cool idea. But I have a question.
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).
Wouldn't it be better if direct access to _ENV would be replaced by
setenv()/getenv() function calls? (Note lack of "f" in function
names.)
Alexander.