On Wed, Mar 31, 2010 at 4:05 PM, MaggotChild <hsomob1999 / yahoo.com> wrote:
> I thought this was odd:
>
> def bs
> 
> end
>
>  ¨Âòéîô éæ âó
>
> NameError: undefined local variable or method `y' for main:Object
>
> And, of course, the multi-line if works:
>
> if x = bs
>  ¨Âòéîô > end

Something like this came up a few weeks ago. I think the parser is the
one generating the NameError, because the parser only consider a
variable to be defined if it sees an assignment to it, and such
assignment has to come *before* any use of the variable. Even though
the interpreter actually would actually execute y = bs first, the
parser doesn't see it at the point where its value is used.