On Aug 26, 2006, at 16:16, David Vallner wrote:

> Pavel Smerk wrote:
>> David Vallner wrote:
>>> Pavel Smerk wrote:
>>>
>>>> OMG!
>>>>
>>>> Why the and and or operators have the same priority? Unlike &&  
>>>> and || and also unlike the most of, or maybe all, other  
>>>> languages and conventions?
>>>>
>>>> (Yes, long time spent on that now, who would expect such a  
>>>> curiosity...)
>>>>
>>>> Thanks for explanation, if there is any,
>>>>
>>>> P.
>>>>
>
> For what it's worth though, since most programmers DO expect  
> mathemathical rules to hold in programming languages, for the sake  
> of consistency, I agree that the and should bind more tightly than  
> or now that that's been brought up.

Is that actually a mathematical rule, though?  I don't remember as  
such from any math or logic that I know, and poking around through my  
old textbooks made no mention of binding or precedence of logical  
operations; the closest thing being a statement that parentheses are  
required to avoid ambiguity when mixing and and or in one statement,  
at least slightly implying that there is no 'order of operations'.

If anyone has a reference either way on this, I'd be curious to see it.

matthew smillie.