"David Heinemeier Hansson" <david / loudthinking.com> schrieb im Newsbeitrag news:8609BD15-45EF-11D8-A416-000A958E6254 / loudthinking.com... > I consider the following statements to be perfectly legit (although > perhaps slightly ambigious) and Ruby does obey, but throws this > mandating warning. Am I just being paranoid or is Ruby forcing a style > upon me :)? > > irb(main):008:0> if a = 1 then true else false end > (irb):8: warning: found = in conditional, should be == > => true > irb(main):009:0> a > => 1 > > irb(main):010:0> if a = nil then true else false end > (irb):10: warning: found = in conditional, should be == > => false > irb(main):011:0> a > => nil Just a side remark: assignment in conditional is only used in loops. "if" never needs this. You can always put it onto two lines even gaining readability: a = 1 if a then ... Besides of that you can do a = 1 and ... This will look familiar to P*rl users. You only really need it in situations like this: while ( line = gets ) ... end Cheers robert