From: Seb Clediere Date: 2003-05-30T22:31:16+09:00 Subject: Re: local variable and local variable in block behave differently Hi, dblack@superlink.net wrote: > I'm not sure what aspect of it is surprising you, but maybe it has to > do with the fact that the assignment causes the variable to be defined > (even if, at runtime, the assignment isn't executed): > > $ ruby -e 'if false; b = 1; end; p defined?(b)' > "local-variable" > > Does that help explain it? > > > David > Sorry, I should have been more explicit. What surprises me is that in one case, the variable a has still its value "a" wherease in the other case, b is nil. I would have expected both cases to be the same, the assigned value. Seb.