lua-users home
lua-l archive

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


> > One approach to introduce global/local without breaking old
> > code or habits might be to have two keywords for function
> > declarations.
> >
> > A function declared with the "function" keyword would
> > continue to behave as it always has.
> >
> > A function declared with another keyword (say, "fun"
> > or "proc") would use the new semantics, and only in
> > that context would the "global" keyword be valid.

I'm agreed that undeclared variables defaulting to global is *bad*.

Don't know if I like the sound of that solution. Would a pragma be better? I
believe VB uses "Option Explicit" to force users to declare all variables.
ie. no undeclared variables defaulting to global.

I think this checking functionality can be implemented with fallbacks though
so believe these requests will be ignored.

N