lua-users home
lua-l archive

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




On Wed, Jul 4, 2018, 3:53 PM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:

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.

Now I'm completely confused. I never heard of a compiler that could do that. What does "misspelled identifier" mean to a compiler? I must be missing your point, sorry.

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.