From: Stephen White Date: 2000-12-22T22:53:49+09:00 Subject: [ruby-talk:7950] Re: defined? problem? On Fri, 22 Dec 2000, Dave Thomas wrote: > The two options above differ in that in one the condition textually > precedes the 'something' and in the other it follows it. Variables > first assigned to in the 'something' will therefore be available to > the condition in the modifier form, but not in the conventional form. Simplest example: irb(main):007:0> b NameError: undefined local variable or method `b' for # (irb):7:in `irb_binding' irb(main):008:0> b = 6 if false nil irb(main):009:0> b nil whereas I was expecting another "undefined local variable" error. I agree with Kevin... I expected "if" to behave the same way and that it was a formatting difference. In any event, I avoid games with scoping rules so I haven't encountered this problem before. -- steve@deaf.org