lua-users home
lua-l archive

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



> It is such an excessively bad idea that I would not care to see it as a
> default in Lua.
Hey, keep your pants on!

No one ever said that one should use globals when locals are appropriate. It just happens to be that Lua variables are global by default with _one_ exception: loops. And while there is no doubt that it is usually a very bad idea to use global loop variables, it is an equally bad idea to use global variables within functions. I was (and still am) just a bit curious to lean why it was decided to handle both cases differently, as a programming language is typically easier to learn when having to keep in mind fewer exceptins.