From: Stephen Sykes Date: 2009-11-13T22:44:18+09:00 Subject: [ruby-core:26723] Re: [Bug #2362] undefined variable has value? It's normal, 'a' has been seen by the parser. For more fun: http://pennysmalls.com/2007/10/01/why-ruby-is-not-my-favourite-programming-language/ - Stephen On Fri, Nov 13, 2009 at 3:05 PM, Vit Ondruch wrote: > Bug #2362: undefined variable has value? > http://redmine.ruby-lang.org/issues/show/2362 > > Author: Vit Ondruch > Status: Open, Priority: Normal > Category: core > ruby -v: ruby 1.9.2dev (2009-10-15) [i386-mswin32_90] > > C:\>type test.rb > if false > �a = 5 > else > end > > c = a > d = b > > C:\>c:\ruby\bin\ruby.exe test.rb > test.rb:7:in `
': undefined local variable or method `b' for main:Object (NameError) > > > From my point of view, the variable "a" was never reached. How that can be that it is later defined with nil value? > > > ---------------------------------------- > http://redmine.ruby-lang.org > >