From: Suraj Kurapati Date: 2008-05-03T02:57:34+09:00 Subject: Re: Ruby 1.9 wishlist coderrr wrote: >> who needs a C-style if when we have shell-style boolean expressions? >> >> # example 1 >> true and >> p :true >> >> p :im_outside_of_if >> > > Awesome, I've learned something new. In fact, an if statement in Ruby is nothing more than shell-style booleans: if condition then main_stuff else other_stuff end condition and main_stuff or other_stuff condition && main_stuff || other_stuff All of these do the same thing; they just they have different precedence. > I never though about a newline after an &&. Yes, any operator at the end of a line causes Ruby to treat the next line as part of the overall statement. They're like an implicit \ at the end of a line. -- Posted via http://www.ruby-forum.com/.