Re: local variables and scope
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: local variables and scope
- From: Chris Marrin <chris@...>
- Date: 2005年8月24日 16:31:31 -0700
Diego Nehab wrote:
Hi,
What were the design motivations leading to all variables being
global, and limiting them to the block scope only when 'local' is used ?
Why not the reverse (all variables local to block scope expect where
noted 'global') ?
You can read about the great "Globals-Locals by default" war anywhere
between these two threads:
4 Aug 2005
http://lua-users.org/lists/lua-l/2005-08/msg00132.html
14 Nov 1997
http://lua-users.org/lists/lua-l/1997-11/msg00018.html
Hundreds of good programmers have been killed in the conflict.
In the end, the "Globals" tribe won. Let's not start another one...
In the second incarnation of this battle I came in swinging for the
"locals-by-default" corps and was quickly converted to the other camp
with this single missive:
http://lua-users.org/lists/lua-l/2005-08/msg00139.html
--
chris marrin ,"",ドル
chris@marrin.com b` $ ,,.
(650) 941-9040 mP b' , 1$'
M1 ,.` ,b` ,` :$$'
,|` mP ,` ,mm
,b" b" ,` ,mm m$$ ,m ,`P$$
m$` ,b` .` ,mm ,'|$P ,|"1$` ,b$P ,` :1ドル
b$` ,$: :,`` |$$ ,` $$` ,|` ,$,,ドル`"$$ .` :$|
b$| _m$`,:` :1ドル ,` ,$Pm|` ` :$,ドル..;"' |$:
P$b, _;b$$b1ドル" |$$ ,` ,$$" ``' $$
```"```'" `"` `""` ""` ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'