[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Globals (more ruminations)
- From: Hakki Dogusan <dogusanh@...>
- Date: Mon, 12 Jul 2010 12:28:07 +0300
12/07/2010 00:14, Roberto Ierusalimschy yazmÄÅ:
One possible downside of this is that this very simple Lua program:
a = "Hello World"
global a = "Hello World"
There should be some toggle to control this. A simple one is the
"global" declaration itself. When a chunk uses a global declaration
it switches on the control.
(You may start you chunk with "global NO, THANKS" ;)
Which reminds me Basic's "Option Explicit" :)
"Tip: Use Option Explicit to avoid mistyping the name of an existing
variable or to avoid risking confusion in code in which the scope of
the variable is not clear."