Re: Short circuit question

new topic     » topic index » view thread      » older message » newer message

Christian Cuvier wrote:

> 	Indeed, "or" behaves relative to "and" like addition does relative to 
> multiplication:
> 
> 		a and (b or c)=(a and b) or (a or c)
> (compare with
> 	a * (b + c) = (a * b ) + ( a * c )
> )
> 
> 	For me, this is another confusing aspect of Eu that the relative 
> precedences of "or" and "and" don't mirror those of '+' and '*'. I'm 
> aware that it's much too late to change this, however.

Unlike standard algebra, the distributive property also works the other 
way around in boolean algebra. i.e. As well as:

   a and (b or c) == (a and b) or (a and c)

...,

   a or (b and c) == (a or b) and (a or c)

...is also true [Check if you don't believe it! :) ], even though the 
analagous:

   a + b*c == (a+b)*(a+c)

...is patently false.

In other words 'and' and 'or' distribute over each other and are thus 
equals in this regard.

I'm not sure whether Rob C was thinking about this when he made the 
precedences equal, but IMHO it seems reasonable even if it doesn't match 
with other languages.

Carl

-- 
[ Carl R White == aka () = The Domain of Cyrek = ]
[ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu