[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Patrick Donnelly <batrick@...>
- Date: Thu, 15 Jul 2010 08:58:06 -0400
On Thu, Jul 15, 2010 at 8:34 AM, Jim Whitehead II <jnwhiteh@gmail.com> wrote:
> 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.
Well that's confusing. I would prefer to have it always on. Having it
off until the keyword is used would having confusing interactions if
Function declarations should be declared as well (probably with that
"global function foo ..." syntax, similar to "local function foo").
goes through (I feel it should). So then the user would suddenly have
global checking turned on without intentionally doing it. Better to
just have it always on I think.
There is also a compatibility problem for the "global function foo ...
end" syntax. This code would no longer work as expected:
local foo;
function foo () end
(The local foo would be a function in 5.1 and nil in 5.2.)
--
- Patrick Donnelly
- References:
- Re: Globals (more ruminations), Jim Jennings
- Re: Globals (more ruminations), Mark Hamburg
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Alexander Gladysh
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Juri Munkki
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Patrick Donnelly
- Re: Globals (more ruminations), Jim Whitehead II