From: "Volkmann, Mark" Date: 2002-11-20T05:25:21+09:00 Subject: difference between "and" and "&&" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C29009.BAE5C140 Content-Type: text/plain; charset="iso-8859-1" I thought the only difference between these was precedence, but I'm seeing another difference. a = 'test' b = nil haveBoth = a and b # haveBoth is now equal to 'test' haveBoth = a && b # haveBoth is now equal to nil Is this the expected behavior? What I want to do is verify that two strings are not nil. It looks like I have to use "&&" instead of "and" to do that. *********************************************************************************** WARNING: All e-mail sent to and from this address will be received or otherwise recorded by the A.G. Edwards corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ************************************************************************************ ------_=_NextPart_001_01C29009.BAE5C140 Content-Type: text/html; charset="iso-8859-1" difference between "and" and "&&"

I thought the only difference between these was precedence, but I'm seeing another difference.

a = 'test'
b = nil
haveBoth = a and b
# haveBoth is now equal to 'test'

haveBoth = a && b
# haveBoth is now equal to nil

Is this the expected behavior?

What I want to do is verify that two strings are not nil.
It looks like I have to use "&&" instead of "and" to do that.



***********************************************************************************
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
************************************************************************************
------_=_NextPart_001_01C29009.BAE5C140--