[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: a new proposal for environments
- From: Jonathan Castello <twisolar@...>
- Date: Wed, 24 Feb 2010 22:17:27 -0800
Forgive me if this is a stupid question, but is _ENV going to be a
real variable that's accessible from the script, or a hidden
"internal" variable? If it's a real variable, forgive a second stupid
question: why not assign it to _G instead? I'm not trying to
second-guess anyone, I'm just honestly not sure I understand the
current situation.
~Jonathan
On Wed, Feb 24, 2010 at 10:07 PM, David Manura <dm.lua@math2.org> wrote:
> On Thu, Feb 25, 2010 at 12:03 AM, David Manura wrote:
>> The _ENV or in/do proposals eliminate that restriction, at least on blocks
>
> Or handled in expressions sort-of too, as Roberto suggested:
>
> local o = with(shape)(function(_ENV) return rectangle { point(0,0),
> point(3,4) } end)
>
> local one = module("one", _G, function(_ENV)
> local x = 1
> function a() print(x); x=x+1 end
> end)
>