lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
>
> I still think the main problem is non-intended assignment to globals,
> which creates hard-to-find bugs. The simple policy of requiring a global
> declaration to assign to globals would force programmers to consider
> whether they really want a global variable.

You would also get get that with a $-prefix for globals.  And
as it looks so ugly, people would use locals instead ;-)
At least, every global access stands out.

But however this is addressed, people will realize that accesses
to table(record/structure)-fields have *exactly* the same problem
and will start trying to "fix" that ...

ET