lua-users home
lua-l archive

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




On Wed, Jul 4, 2018, 12:26 AM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
Hi!

Let me start (n+1)-th thread about "global by default" feature of Lua.
 
My suggestion is to replace "global by default" approach with "nothing by default" by introducing special syntax for accessing global variables:

Its one thing to introduce a new special symbol that does not change existing semantics. It's a whole 'nother thing to "replace" existing semantics. You could add $ with special meaning, but then all you've done is clutter the language. If you also "replace" existing semantics, e.g. by changing global-by-default, then you have by definition defined a new language, which is not Lua.

This is a very bad idea. Global-by-default is a fact of life in Lua, and it will never change (I hope). You deal it with by practicing disciplined programming.