[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Geoff Leyland <geoff_leyland@...>
- Date: Mon, 12 Jul 2010 08:58:08 +1200
On 12/07/2010, at 5:14 AM, Roberto Ierusalimschy wrote:
> I still think the main problem is non-intended assignment to globals,
> which creates hard-to-find bugs. The simple policy of requiring a global
> declaration to assign to globals would force programmers to consider
> whether they really want a global variable.
One possible downside of this is that this very simple Lua program:
a = "Hello World"
print(a)
becomes:
global a = "Hello World"
print(a)
(or "local a..."). Does this make Lua harder to learn?
Geoff