From: "Iñaki Baz Castillo" Date: 2008-03-30T12:17:09+09:00 Subject: Re: Extrange behaviour using "if XXX ..." and "XXX if ..." El Domingo, 30 de Marzo de 2008, Tim Hunter escribió: > You must distinguish between parsing and execution. Ruby parses your > program before Ruby executes your program. > > Ruby decides how to interpret the reference to a during parsing, before > Ruby executes the if statements in your examples. Their success or > failure has nothing to do with the decision. In this case > > a if a = "qweqwe" > > Remember parsing occurs from left to right. Ruby sees the reference to a > to the left of the assignment to a. When Ruby first encounters a > reference to a it assumes that since it has not yet seen any assigment > to a, then a must be a method name. Ok, I understand. Thanks a lot. -- Iñaki Baz Castillo