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

[REBOL] Re: order of evaluating expressions..

From: SunandaDH::aol::com at: 23-Dec-2004 14:32

> Correct me if I'm wrong but I was always under the impression we > evaluated the way we do because that's how *math* required them to be > evaluated.
That's true. But there may be more items in a computer language than you learned in school. And the order of precedence of them may not be so intuitive. What is the "correct" order of precedence for? 5 or 7 * 6 and 3 The C language, for example, solves this by having a dozen levels of precedence (In C AND is above OR. Times is above both of them. At least, I think that's right -- and that's one of the problems of having a dozen levels: you need a good memory) REBOL solves that problem in a different way -- by just doing things left to right. That creates its own problems at times too -- a naturalistic line like this is tripped by that rule, meaning parentheses are needed: if length? "aa" = length? "bbb" [print 'true] Sunanda.