[REBOL] Re: Apparent newbie question
From: brett:codeconscious at: 21-Nov-2003 10:01
As you've seen from all the answers so far, precedence matters with
operators. The Core guide says (in the Math section) that there are just two
Expressions are evaluated from left to right.
Operators take precedence over functions.
For a long time while I was learning REBOL I basically ignored operators
like +, -, * etc. Instead I used their function equivalents: Add, Subtract,
Multiply. Once I got comfortable with the precedence rules of operators I
started using a mix. Eg.
Add 3 * X 4 * Y
(3 * X) + (4 * Y)
Every now and then I get the precedence stuff mixed up and instead of
inserting heaps of paren! I revert to using the function style.
Most recently, after Joel's post on coding habits and the effect of changing
them, I've started using a different habit for If conditions more akin to
the other posts.
if x = 4 * Y [...]