[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Globals vs. Locals
- From: Uli Kusterer <witness.of.teachtext@...>
- Date: Thu, 4 Aug 2005 20:04:02 +0200
if I understood this correctly, the way variables work in Lua is
that they are global by default, and you explicitly declare those
local that you want to be thus. Is there any place where I can find
information on why it was designed this way, which is pretty much the
opposite of the major languages?
So far I thought it was safer if variables are local by default, so
code can't accidentally change another object's variables (e.g.
during a recursive call).
-- M. Uli Kusterer