From: roob noob Date: 2012-07-20T13:05:38+09:00 Subject: unless if not == unless post_on_ruby_forum So everything I have thus far read and heard about the Ruby unless keyword lead me to believe that it is just another word for if not. This is not true. unless 1 + 1 == 2 puts "a" elsif 1 + 1 == 5 puts "b" else puts "c" end this code fails and complains that it expects an end to be where elsif is however if not 1 + 1 == 2 puts "a" elsif 1 + 1 == 5 puts "b" else puts "c" end works as expected. This took me quite a while to figure out as everyone had always lead me to believe that unless is just the cool kids way of saying if not in ruby. So I guess my question is, are there any other unexpected behaviors of unless that I should know about? I think I might just start using if not and ignoring unless, I actually end up having to translate it to if not in my head anyway to read things clearly, and it doesn't work with elsif. Why does everyone rave about how unless is exactly like if not but with clearer language, if this is not the case ? -- Posted via http://www.ruby-forum.com/.