[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Jim Whitehead II <jnwhiteh@...>
- Date: Thu, 15 Jul 2010 13:34:49 +0100
On Thu, Jul 15, 2010 at 1:33 PM, Patrick Donnelly <batrick@batbytes.com> wrote:
> On Thu, Jul 15, 2010 at 8:18 AM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
>>> I think I like what Roberto Ierusalimschy is suggesting, assuming I'm
>>> understanding it correctly. Here's how I see a "global" declaration
>>> keyword working:
>>>
>>> [...]
>>
>> Your interpretation (so far, at least) is correct.
>
> I may misunderstand but from his code:
>
>>> a = 10; -- a is a global (global assignment checking isn't enabled yet)
>>> b = 20; -- b is a global too
>>>
>>> global checks; -- using the global keyword turn global assignment checking on.
> -- "checks" is a global, but it's just a dummy in
> this case and not used.
>
> "global checks" as a statement doesn't "turn on" global assignment
> checking? Global assignment checking would be always on? Or is this
> simply how it works at the file chunk level? (Perhaps a new thread
> discussing the new change is warranted like the earlier "a new
> proposal for environments" thread. It would be most helpful to have an
> authoritative description of the proposed design.)
When Roberto introduced this, he said that the checking wouldn't be
turned on until the keyword was used (or some other trigger happened).
I believe that's what is happening here.
- Jim