Jack - thanks for the handy summary. I've put up a wiki page around this at http://www.jsoftware.com/jwiki/DevonMcCormick/RightToLeftAdvantages .
Regards, Devon On 7/20/08, Jack Andrews <[EMAIL PROTECTED]> wrote: > > On Sat, Jul 19, 2008 at 8:09 AM, Roger Hui <[EMAIL PROTECTED]> wrote: > > > http://www.jsoftware.com/jwiki/Doc/Elementary_Functions_An_Algorithmic_Treatment#evaluation_order > > > > by Ken Iverson, 1966. > > > in the interest of searchability, i copy the points on page 222 here: > > The reasons for a right-to-left instead of a left-to-right convention are: > 1. The usual mathematical convention of placing a monadic function to > the left of its argument leads to a right-to-left execution for > monadic functions; for example, F G x = F (G x) [0] > 2. The notation F/ z for reduction (by any dyadic function F) tends to > require fewer parentheses with a right-to-left convention. For > example, expressions such as +/ (x * y) [1] or +/ (u/x) tend to occur > more frequently than (+/ x) * y and (+/ u) / x. > 3. An expression /evaluated/ from right to left is easiest to /read/ > from left-to-right. For example, the expression > a + x * b + x * c + x * d + x * e + x * f > (for the efficient evaluation of a polynomial) is read as a plus the > entire expression following, or as a plus x times the following > expression, or as a plus x times b plus the following expression, and > so on > 4. In the definition > F/ x = x1 F x2 F x3 F ... F xn [0][2] > the right-to-left convention leads to a more useful definition for > nonassociative functions F than does the left-to-right convention. For > example, -/ x denotes the alternating sum of the components of x, > whereas in a left-to-right convention it would denote the first > component minus the sum of the remaining components. Thus if d is the > vector of decimal digits representing the number n, then the value of > the expression 0 = 9|+/ d determines the divisibility of n by 9; in > the right to left convention, the similar expression 0 = 11|-/ > determines divisibility by 11. > > [0] the symbol '=' here means congruence (triple horizontal lines in > the original) > [1] the symbol '*' here and later means multiplication ('x' in the > original) > [2] the 'n' in xn is denoted {rho} x in the original > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
