[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: One more item to the collection of Lua hate-speech
- From: Vaughan McAlley <vaughan@...>
- Date: Thu, 8 Jul 2010 16:04:17 +1000
On 8 July 2010 12:44, RJ Russell <russellsprouts2@gmail.com> wrote:
> add one new keyword, global, and keep the local keyword.
> Everything is local by default, not overriding any already existing locals, but the global keyword makes a global, and the local keyword creates a new one.
>
> a=1 --auto local
> do
> a=2 --same one
> end
>
> (Though 5.3work3 with _ENV changes a lot.)
>
I think using the local keyword makes it easier to spot a variable‘s
scope when scanning code. It would be less obvious whether a variable
is a local or an upvalue (or a global declared elsewhere).
Vaughan
- References:
- One more item to the collection of Lua hate-speech, Alexander Gladysh
- Re: One more item to the collection of Lua hate-speech, Luiz Henrique de Figueiredo
- Re: One more item to the collection of Lua hate-speech, Petite Abeille
- Re: One more item to the collection of Lua hate-speech, Wim Couwenberg
- Re: One more item to the collection of Lua hate-speech, Mark Hamburg
- Re: One more item to the collection of Lua hate-speech, Mark Hamburg
- Re: One more item to the collection of Lua hate-speech, Roberto Ierusalimschy
- Re: One more item to the collection of Lua hate-speech, Geoff Leyland
- Re: One more item to the collection of Lua hate-speech, Roberto Ierusalimschy
- Re: One more item to the collection of Lua hate-speech, RJ Russell