From: Robert Klemme Date: 2008-06-17T23:39:02+09:00 Subject: Re: print(true and true) #=> the parenthesis issue On 17 Jun., 16:07, Dave Bass wrote: > I've always used "&&" rather than "and". I know the two operators have > different precedences. The "&&" version comes naturally to me, thanks to > a C background. I use "&&" in expressions (because of the precedence) and "and" when I want to combine some "statements". > Can someone give non-contrived examples where "and" works nicely but > "&&" doesn't? I.e. what is the reason for including "and" in the > language, as it seems redundant to me. (The Pickaxe says "just to make > life interesting".) 16:35:55 OPSC_Gold_bas_dev_R1.2.2_prj$ ruby -ce 'x = some_work() && puts x' -e:1: syntax error, unexpected tIDENTIFIER, expecting kDO or '{' or '(' 16:36:09 OPSC_Gold_bas_dev_R1.2.2_prj$ ruby -ce 'x = some_work() and puts x' Syntax OK Does that give a clue? Kind regards robert