lua-users home
lua-l archive

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


On 2/07/2010, at 10:48 AM, David Given wrote:

> Me, too --- but if you look back at the list archives you can find
> endless arguments about local-by-default (which is horrible) vs
> local-by-default (which is slightly less horrible). The usual conclusion
> is neither-by-default would be better but that it's now too late to change.


(I think you meant global-by-default the second time?)

I'd say:

local-by-default: flawed
global-by-default: works, care required
neither-by-default: works, extra typing or extra visibility depending on your point of view

strict.lua gives you some of the advantages of neither-by-default without extra typing, and I imagine further fiddling with _G's __newindex can offer extra visibility.

That's what I like about Lua: the core of the language seems carefully designed, and it has mechanisms to do what suits you best.

Cheers,
Geoff