[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lambda (was Re: special forms, take two (was Re: A lua version of "amb"))
- From: Mark Hamburg <mark@...>
- Date: Thu, 1 Mar 2012 06:25:22 -0800
On Mar 1, 2012, at 6:02 AM, Tony Finch wrote:
> Mark Hamburg <mark@grubmah.com> wrote:
>>
>> What if the lightweight syntax didn't support functions with upvalues?
>> One could still reference globals, but a reference to a lexically bound
>> but non-local variable would be an error in a lambda expression,
>> whatever the syntax.
>
> Note: in 5.2 _ENV is an upvalue; forbidding upvalues also forbids globals.
_ENV is a magic upvalue. Magic rules might apply. Or simply that these horrendously restricted lambdas would exist at and be created at the chunk scope but the compiler would check to make sure that shifting their scope in that way didn't convert upvalue references to global references.
Mark