[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: One more item to the collection of Lua hate-speech
- From: Christopher Eykamp <chris@...>
- Date: Thu, 01 Jul 2010 15:31:31 -0700
In Bitfighter (a game with Lua scripting), I require users to explicitly
declare their vars as either local or global, so there is no ambiguity.
Using an undeclared variable produces an error.
This also helps identify spelling errors.
On 7/1/2010 3:20 PM, Geoff Leyland wrote:
On 2/07/2010, at 9:58 AM, HyperHacker wrote:
On Thu, Jul 1, 2010 at 15:18, liam mail<email@example.com> wrote:
If I were to be totally honest the thing which I dislike most about Lua is
the keyword 'local'...
I agree, defaulting to global scope is one thing that always irks me
I'm sure it has some advantages, but they're escaping me at the moment.
Local by default used to confuse me no end in Python. If Lua used it then:
a = 1
a = 2 -- is this a new local or the same as the one above? How do I tell Lua whether I want it to be the same or different?
print(a) -- does this print 1 or 2?
I much prefer global by default - it seems do be defined better.