From: Gary Wright Date: 2011-01-25T05:26:33+09:00 Subject: Re: The finer points of postfix conditionals. On Jan 24, 2011, at 1:18 PM, Jon Leighton wrote: > Thanks for the explanation. FWIW I think it is a shame that postfix > conditionals are semantically different to normal ones, but it's good to > know why the difference occurs. I think you are reversing cause and effect. The postfix condition is not the source of the semantic surprise. The surprise comes from the way Ruby disambiguates local variables from argument-less method calls *at parse time*. You can contrive other examples of this surprise: x rescue puts("x isn't a method here") x = true puts "x is now a local variable" if x x rescue puts("this won't fail now because parser thinks x is a local variable") x() rescue puts ("x still isn't a method") Gary Wright