To view parent comment, click here.
To read all comments associated with this story, please click here.
That's an interesting idea, which would indeed fit best with common people's experience. The nice thing about REBOL is that it's a meta language: you have control over how the language is evaluated. REBOL makes it easy to write an expression evaluator that would use the rules you stated. I would indeed implement such an evaluator if I would allow users to enter their own expressions, for example in a calculator application.
I absolutely disagree. There are 2 choices to my mind:
1. Use standard precedences for arithmetic, comparison and logic operators as defined in common mathematical usage.
2. Have everything use standard precedences.
C's implementation is actually flawed - Ritchie himself acknowledges so (http://cm.bell-labs.com/cm/cs/who/dmr/chist.html), so blindly copying that seems the wrong approach.
From the horses' mouth, so to speak, on math precedence in REBOL:
http://www.rebol.com/r3/docs/concepts/math-precedence.html
Your link's dead, but you can get to it here:
http://webcache.googleusercontent.com/search?q=cache:cm.bell-labs.c...
The only issue I can find in the document is that boolean and bitwise operators have a somewhat weird relationship (boolean comes before bitwise.) The example being:
if((a&mask)==b)
the second set of parenthesis are required.




Member since:
2005-07-06
So your justification that Rebol has a strange behaviour because C has also a strange (different) behaviour??
Both are wrong IMHO: the best behaviour is: associativity as in math for + - * / and for all the other operators Rebol behaviour.