From: "K.Kosako" Date: 2001-04-20T11:59:35+09:00 Subject: [ruby-talk:13909] Re: local vars in case From Guy Decoux <200104191131.f3JBVKl29014@orsay1.moulon.inra.fr> > >> [0,1].each {|n| > >> print "n: #{n}\n" > >> case n > >> when 1 > >> a = 0 > >> print "a: #{a}\n" # => 0 > >> when 0 > >> b = 1 > >> print "a: #{a}\n" # => "a: " (a == nil) > >> print "b: #{b}\n" > >> end > >> } > > I've reversed the `when', normally I expect Sorry, I didn't notice the changes of that script. An actual result is the following. n: 0 local3.rb:9: undefined local variable or method `a' for # (NameError) from local3.rb:1:in `each' from local3.rb:1 I myself can't permit this result. Thank you. ---- K.Kosako