[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 15 Jul 2010 10:32:34 -0300
> 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.
Only if the user uses the global option. "function foo" works as today;
it expands to "foo = function ..." (whatever foo is). "global function foo"
expands to "global foo = function ...".
Global declaration cannot be on by default because of (1) compatbility
and (2) easyness for writing config files and interactive code.
-- Roberto
- References:
- 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
- Re: Globals (more ruminations), Patrick Donnelly