From: "Hal E. Fulton" Date: 2003-08-21T04:05:38+09:00 Subject: Re: for/in loop ----- Original Message ----- From: "Kurt M. Dresner" To: "ruby-talk ML" Sent: Wednesday, August 20, 2003 1:07 PM Subject: Re: for/in loop > What do you mean by it would work? The first one will raise a > NameError, or the second one will output 3 ? I think it's a minor problem with Matz's English. I believe he means "it will work when the new scoping rule is introduced" or "it would work, if the new scoping rule were already in place." Hal > -Kurt > > On Thu, Aug 21, 2003 at 01:56:44AM +0900, Yukihiro Matsumoto wrote: > > Hi, > > > > In message "Re: for/in loop" > > on 03/08/21, Paul Brannan writes: > > > > |It's definitely not pointless: > > | > > | for i in [1, 2, 3] > > | x = i > > | end > > | p x #=> 3 > > | > > | [1, 2, 3].each do > > | y = i > > | end > > | p y #=> test.rb:9: undefined local variable or method `y' for # (NameError) > > > > Yes, but it would work, when new scoping rule is introduced. > > > > matz. > > > >======= End of Original Message =======< >