From: Colin Bartlett Date: 2010-08-18T09:09:25+09:00 Subject: Re: Strange behavior of or condition in loop --0016367b5f20bbf08b048e0de0c3 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 18, 2010 at 12:40 AM, skim wrote: > and/or aren't the same as &&/||. they have lower operator precedence than > latter. > And to be particular for the OP's problem "and" and "or" have lower precedence than "=" assignment. (And have the same precedence as each other.) So dirty = dirty or found is being parsed as (dirty = dirty) or found But since "&&" has a higher precedence than "||" which has a higher precedence than "=" assignment, if you replaced the "or" in the unbracketted version by "||" you should now get the results of the bracketted version. (At least, it worked for me just now.) skim: Thanks for the link - I mostly use "&&" and "||" (and sometimes also parentheses just to be sure and to be explicit) but the explanations of the history will probably make it easier for me to remember the precedence of "and" and "or" when I see them being used. --0016367b5f20bbf08b048e0de0c3--