D
David Heinemeier Hansson
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
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