[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: explicit mode
- From: Andrew Starks <andrew@...>
- Date: Tue, 10 May 2016 18:32:28 +0000
To answer your question:
One of Lua's main use cases is as a configuration language. That is:
Window_x = 5
Window_y = 100
...is a very useful syntax for a configuration file that you might employ in your application. Adding "global" or "local" to the front of each declaration would be ugly and detract from this simplicity. Hopefully, in this context, we can agree that "global by default" makes some sense.
Given that, we should keep in mind that Lua's simplicity is another primary objective. Since "strict.lua" (already mentioned) is able to provide a way to guard against accidental globals, the case for providing a language-level mechanism is more or less rendered redundant. In Lua, when something is identified as redundant, it is removed, unless there is an overwhelmingly convincing case to include it and replace the old mechanism and so here we are.
I like using Lua to solve real-world, big problems. Its primary use cases put design limitations on it that sometimes run counter to what I would otherwise want. It's part of its charm.
That is how I've come to accept these sorts of questions, anyway.