[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.2 (was: modules, require, magic)
- From: Josh Simmons <simmons.44@...>
- Date: Thu, 20 Oct 2011 14:08:01 +1100
On Thu, Oct 20, 2011 at 2:03 PM, Ben Kelly <email@example.com> wrote:
> On Wed, 19 Oct 2011 14:48:17 -0400
> Patrick Donnelly <firstname.lastname@example.org> 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.