From: Josh Cheek Date: 2011-08-15T22:33:23+09:00 Subject: Re: Ternary statement needing parenthesis..(?) --bcaec548666482244b04aa8b4e58 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Aug 15, 2011 at 8:05 AM, Michelle Pace wrote: > Hello, just wondering why is it that I have to use the parenthesis in > the below ternary statement? (A.) works fine but (B.) bombs out with a > syntax error:- > > (1) 60 > 55 ? puts("when true") : puts("when false") > (2) 60 > 55 ? puts "when true" : puts("when false") > > > cheers Michelle > > -- > Posted via http://www.ruby-forum.com/. > > It doesn't know that the colon is delimiting the ternary, it thinks it's doing something like denoting a symbol, or a hash, or beginning a scope resolution (Larry's First Law of Language Redesign: Everyone wants the colon.) --bcaec548666482244b04aa8b4e58--