From: yermej Date: 2008-03-05T06:19:55+09:00 Subject: Re: and statement On Mar 4, 8:23 am, Lionel Bouton wrote: > 7stud -- wrote: > > Subbu wrote: > >> Thank you so much. I looked up 'and' && operands in the PickAxe book > >> and this is what it says: > >> "The 'and' and && operators evaluate their first operand. If false, > >> the expression returns the value of the first operand; otherwise, the > >> expression returns the value of the second operand" > > > Which doesn't appear to be true. Look at this: > > > result = (x=20) > > puts result #20 > > > result = true and x=20 > > puts result #true > > Precedence... > > result = (true and x = 20) Or: result = true && x = 20 The precedence is the only difference between 'and' and '&&'.