lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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