lua-users home
lua-l archive

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


On Thu, Oct 20, 2011 at 2:08 PM, Josh Simmons <simmons.44@gmail.com> wrote:
> On Thu, Oct 20, 2011 at 2:03 PM, Ben Kelly <ranavin@gmail.com> wrote:
>> On Wed, 19 Oct 2011 14:48:17 -0400
>> Patrick Donnelly <batrick@batbytes.com> wrote:
>>>
>>> For those of us who've made complicated sandboxes where setfenv and
>>> the debug library can still exist, you will appreciate the
>>> introduction of _ENV. setfenv was and is a huge PITA to sandbox.
>>>
>> On the other hand, if you don't have access to the source of the thing
>> you're trying to sandbox, it may be the only way you have available.
>>
>> Personally, what I'll miss most is DSL creation. The ability to swap
>> around the caller's environment silently makes it easy to create
>> "keyword-like" functions that hugely simplify the structure of
>> configuration and game-behaviour files. Having to tack _ENV in front of
>> each of those is not only very ugly, it confuses the modders.
>>
>> Yeah, I can use debug.setupvalue(), but now I'm using the debug library
>> in release code, which last I checked was considered extremely
>> inappropriate under any circumstances.
>>
>>        Ben Kelly
>>
>>
>
> Urgh you don't have to use _ENV to do this.
>
> http://www.lua.org/work/doc/manual.html#pdf-load
>

Oh you mean changing the environment all through the script. I really
don't understand why people think this is a good idea or that it makes
things more readable.