lua-users home
lua-l archive

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


Hi,

12/07/2010 00:14, Roberto Ierusalimschy yazmış:
One possible downside of this is that this very simple Lua program:

a = "Hello World"
print(a)

becomes:

global a = "Hello World"
print(a)

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."


-- Roberto