
Hi boosters, In operators.html (a || b) is said to be equivalent to (a | b | a >> b), but, if I understand precedence correctly, it should be equivalent to (a >> b | a | b). I'm just learning Spirit, so this may probably be my mistake, right? Cheers, Bruno Martinez ---------------------------------------------------- ATENCION Su servicio de correo tiene antivirus ?? @internet URUGUAY: http://www.internet.com.uy

Bruno Martínez wrote:
Hi boosters,
In operators.html (a || b) is said to be equivalent to (a | b | a >> b), but, if I understand precedence correctly, it should be equivalent to (a >> b | a | b). I'm just learning Spirit, so this may probably be my mistake, right?
Actually it's equivalent to (a >> !b | b). The difference being that any semantic action on 'a' will only be executed once. -- Rainer Deyke - rainerd@eldwood.com - http://eldwood.com

Rainer Deyke
Bruno Martínez wrote:
Hi boosters,
In operators.html (a || b) is said to be equivalent to (a | b | a >> b), but, if I understand precedence correctly, it should be equivalent to (a >> b | a | b). I'm just learning Spirit, so this may probably be my mistake, right?
Actually it's equivalent to (a >> !b | b). The difference being that any semantic action on 'a' will only be executed once.
You are right! Thanks for noticing that! I didn't really give it much thought. I'll update the docs. -- Joel de Guzman joel at boost-consulting.com http://www.boost-consulting.com http://spirit.sf.net

Bruno Martínez
Hi boosters,
In operators.html (a || b) is said to be equivalent to (a | b | a >> b), but, if I understand precedence correctly, it should be equivalent to (a >> b | a | b). I'm just learning Spirit, so this may probably be my mistake, right?
No, you are right. Thanks for spotting that. I'll correct the docs to avoid confusion. -- Joel de Guzman joel at boost-consulting.com http://www.boost-consulting.com http://spirit.sf.net
participants (3)
-
Bruno Martínez
-
Joel de Guzman
-
Rainer Deyke