From: "Peña, Botp" Date: 2007-09-19T11:51:02+09:00 Subject: Re: Variable / Method Ambiguity From: 7stud -- [mailto:dolgun@excite.com] # In ruby, for loops and if clauses don't create a scope. irb(main):001:0> if false irb(main):002:1> x irb(main):003:1> end => nil irb(main):004:0> x NameError: undefined local variable or method `x' for main:Object from (irb):4 irb(main):005:0> if false irb(main):006:1> x = 5 irb(main):007:1> end => nil irb(main):008:0> x => nil they can introduce a var (under the existing local scope of course). i think its in the assignment behaviour if you look at it. parser sees assignment even if code is not executed. ruby just try to be friendly, but you can be sloppy if you want to and ruby will not give you an error :) again, i think this is a faq. kind regards -botp