lua-users home
lua-l archive

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

On Thu, Jul 8, 2010 at 12:45 PM, Mark Hamburg <> wrote:
> Why are globals "bad"?... Why are globals "good"?

I would qualify such discussions with the comment that there are
important aspects of globals and locals in Lua that are specific to
Lua and not to other languages.  For example, the scope of a Lua
global can be a proper subset of the scope of a local, which seemingly
is counter-intuitive, as it was for me [1].  The mantra "globals are
bad", as used elsewhere, therefore is using the term "global" not in
the exact same sense as used here.

So, here's a new page outlining the fundamental differences between
locals and globals as implemented in Lua: .

[1] -
"global/local a misnomer?"