|
I do not hate globals :-)
I'm trying to solve the problem "the compiler silently ignores all variable name typos".
It's the expectation of many programmers that a compiler should check for misspelled identifiers and warn the user at compile time.
And the global-by-default feature is the only thing in Lua that prevents this to happen.
All existing solutions are actually run-time checkers, they are unable to solve the problem.
And simultaneously I want to solve another problem "globals are accidentally shaded out by locals with the same name".
"$" solves both these problems.