[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: AW: AW: AW: AW: non-locals are only sometimes global?
- From: "Warlich, Christof" <christof.warlich@...>
- Date: Wed, 21 Jul 2010 14:55:44 +0100
> It is such an excessively bad idea that I would not care to see it as a
> default in Lua.
Hey, keep your pants on!
No one ever said that one should use globals when locals are appropriate. It just happens to be that Lua variables are global by default with _one_ exception: loops. And while there is no doubt that it is usually a very bad idea to use global loop variables, it is an equally bad idea to use global variables within functions. I was (and still am) just a bit curious to lean why it was decided to handle both cases differently, as a programming language is typically easier to learn when having to keep in mind fewer exceptins.
- References:
- non-locals are only sometimes global?, Warlich, Christof
- Re: non-locals are only sometimes global?, steve donovan
- AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: non-locals are only sometimes global?, Peter Odding
- AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: non-locals are only sometimes global?, Peter Odding
- AW: AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: non-locals are only sometimes global?, Matthew Wild
- AW: AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: AW: non-locals are only sometimes global?, David Kastrup