From: hal9000@... Date: 2000-12-22T07:10:04+09:00 Subject: [ruby-talk:7920] Re: defined? problem? > > c> j = 0 if not defined? j > > At compile time, ruby resolve `j' as a reference (in the 2 cases) to a > local variable, because `j = 0' was seen *before* `defined? j' > > At runtime, because `j' is a local variable, it is also defined and ruby > don't execute the code `j = 0' this mean that j contain nil > That's a reasonable explanation, but it seems somewhat annoying behavior to me... Hal -- Hal Fulton Sent via Deja.com http://www.deja.com/