Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Apparent newbie question

From: brett:codeconscious at: 21-Nov-2003 10:01

Hi Steven, 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 rules: 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 instead of (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 [...] Regards, Brett.