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

[REBOL] Re: operator precedence, just curious...

From: joel:neely:fedex at: 5-Oct-2001 17:59

Hi, all, Gregg Irwin wrote:
> You have to use parens in REBOL to force operator precedence: > > >> (6 * 7) - (3 / 4) > == 41.25 > > Or you could also do it this way if you're an RPN kinda' guy: > > >> subtract multiply 6 7 divide 3 4 > == 41.25 >
Not that I'd ever be picky... ;-) ... but that's actually PN (Polish Notation, in which the operator comes before its operands), not RPN (Reverse Polish Notation, in which the operator follows its operands). RPN is most commonly seen in FORTH (and certain H-P calculators), where the above expression would have been written as 6 7 * 3 4 / - (Elvis has backed out of the building!) -jn- -- The only thing scarier than a sysadmin with a screwdriver is a programmer with the root password. -- Matt Korth joel^FIX^PUNCTUATION^dot^neely^at^fedex^dot^com