Subbu
3/10/2008 4:28:00 PM
On Mar 4, 1:18 pm, yermej <yer...@gmail.com> wrote:
> On Mar 4, 8:23 am, Lionel Bouton <lionel-subscript...@bouton.name>
> 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 '&&'.
Does that mean = has higher precedence than 'and'?