From: Suraj Kurapati Date: 2008-05-03T02:02:55+09:00 Subject: Re: Ruby 1.9 wishlist coderrr wrote: > 2) two line if/while statements (like c): > if true > p :true > p :im_outside_of_if > > I'm a huge fan of one liners like: > x if y > > ... but sometimes it just doesn't fit on one line and you need to do > if x ... end. Needing an extra line for that end really really > sucks. Shouldn't we be able to do it C style and save a line? IMHO a C-style single-line if statement is more trouble than it's worth. It makes me cringe every time I see such a thing in C/C++/Java code (I always put braces around my code blocks, just like Perl requires). Besides, who needs a C-style if when we have shell-style boolean expressions? # example 1 true and p :true p :im_outside_of_if # example 2 -- beware of '&&' vs 'and' precedence true && (p :true) p :im_outside_of_if -- Posted via http://www.ruby-forum.com/.