[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Deprecating setfenv()
- From: Bertrand Mansion <lua@...>
- Date: Sat, 9 Jan 2010 15:07:06 +0100
On Sat, Jan 9, 2010 at 2:30 PM, Miles Bader <miles@gnu.org> wrote:
> Peter Odding <peter@peterodding.com> writes:
>> This is obviously already possible in Lua 5.1, but more importantly it
>> is one very narrow use-case of setfenv(). I've grown to appreciate
>> setfenv() as core Lua functionality and now it is being deprecated
>> without a replacement...
>>
>> Finally I'm getting to my point: I'm wondering what made the Lua authors
>> decide to remove setfenv() and replace it with a very narrow subset of
>> its functionality?!
>
> and getfenv, which has _no_ replacement as far as I can see...
>
>> Of course I'm hoping that I misunderstood the replacement or can
>> change the Lua authors' minds about it, but if neither of those is an
>> option than I'll settle for a clear understanding of the decision
>> making process :-)
>
> Yes, it would be useful to know _why_ these changes are being made...
Personally, I never liked setfenv/getfenv, so I think what Lua authors
have done is really an improvement.
I am glad these two functions will be moved to debug, that's where
they belong. I wouldn't call this "deprecated", in my opinion it is
just a clear sign that these functions are lower-level and that there
are now more user-friendly ways to achieve similar things. Besides,
the new syntax is a lot more readable in my opinion and leads to code
that is easier to maintain. That's just my opinion, it probably
doesn't reflect Lua authors'.
--
Bertrand Mansion
Mamasam