lua-users home
lua-l archive

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


The main thing I do not like is "global-by-default" and there seems to be a fair bit of support for that. Compatibility does not need to be a problem if the transition is thought through. New Lua hosts can adopt global-by-declaration, existing hosts upgrading Lua can switch it on or off. Individual chunks can reverse the implementation default with a directive at the start of each chunk.

However I do not really see why local-by-default is such a problem. In the Lua cant, it just means that if "x" cannot be resolved at any point in interpretation, "x = 1" gets treated as "syntactic sugar" for "local x; x = 1". Of course, if you want it to be in an outer scope, you have to pre-declare in that scope.