lua-users home
lua-l archive

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


> I agree, defaulting to global scope is one thing that always irks me
> in Lua. It's easy to define a local variable in some module function,
> then later delete the definition but neglect to delete an assignment -
> now it's a global variable that suddenly appears, causing potential
> confusion. Not to mention inexperienced/lazy programmers making
> everything global because they don't realize/forget/don't care that
> they need to specify otherwise, thus polluting the global namespace.

> I'm sure it has some advantages, but they're escaping me at the moment.

Perhaps this wiki page would be useful:

http://lua-users.org/wiki/LocalByDefault

Alexander.