Why 'if 0' succeeds in Ruby

I agree with you. I am also used to this. nil should never == true, and
neither be == false. Every comparison with nil should just fail.

Every comparison with nil (except with itself) does fail.

“unless foo” is not a comparison of foo with false, it is exactly
equivalent to “if not foo”.

You seem to be recommending an SQL-style 3-value logic which is

For the second time so far: His statement is jargon, and is not to be
taken
literally. His code sample showed what he meant!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs