mijj wrote: > > hmm ... i can't say i'm convinced. (unwise as it is for me to say that > of Iverson's thinking in this forum! .. but this is purely for the sake > of chat, isn't it.) > > (the part relevant to L<-R convention from > http://www.jsoftware.com/papers/EvalOrder.htm > is quoted at the end) > > 1. is convention that important? we're already shifting gears wrt > conventions. >
Convention is important, because we need some way to decipher what, for instance, a-b-c means: is it a-(b-c) or (a-b)-c? This "shifting of gears wrt conventions" is just choosing among a number of conventions---the choice is as provisional as necessary to fix the rules. Iverson argues for the right-to-left order of evaluation convention as being more convenient, giving arguments in support of this choice which you have quoted. > Once we're immersed in L->R then: x G F :would naturally > be read as: we have x, then G is applied, then F is applied. The > situation is constructed as we progress naturally from L->R. > Two remarks: 1) There is too much naturalness going on here :-) 2) In math, f o g is a standard notation for composition of two functions. It, however, implies that g is applied before f, so would not be more natural to write g left of f to make things similar to the process of application of functions in the ubiquitous left-to-right convention of reading? In category theory there is a notation for this: composition of two arrows f and g is sometimes written as g ; f , i.e g ; f = f o g Note that in J, expression G F is exactly the notation for composition of adverbs G and F, in that order. If we're > discarding conventions, then discard the lot and begin with a clean slate. > What would the "clean state" be? What if it's conventions all along the way? The most important one is operation of parenthesizing. It could always be used to fix uncertainties and impose the order of evaluation (as in LISP), and Iverson's main concern is how to reduce the number of brackets by way of adding rule(s) for binary operations (as in APL, J). We could add priorities for binary operations (state of the art would be Haskell), but that's too complicated to memorize. Ok, then let's add one rule for all binary operations. There are two choices: x u y v z is either (x u y) v z or x u (y u z), etc. > 2. our L<-R construction is written: +/(X.Y) :.. for L->R it would be > written as: Y.X/+ :so no problem as long as we're consistant with our > handedness. > Ok, but that's not the issue at stakes, because we could always say: Instead x u y v z being interpreted as x u (y v z), we could interpret it as (z v~ y) u~ x, in J notation, and then change the order of evaluation to be left-to-right to eliminate parentheses by convention, which, if I understand it correctly, is what your L->R means. > 3. i'll give you that one. .. on the other hand .. once we're immersed, > then we know to read L->R and L<-R according to whether we want to travel > from woods to trees or trees to woods. > The previous remark applies here as well. > 4. in L->R: x/- :would be the expression for alternating sum of > components. In L->R: a-b :would mean the displacement from a to b .. ie > starting from a and travelling to b (as in the X axis of a graph). > And: d/+|9=0 :would represent divisibility (of n represented by digits > d) by 9 in L->R .. and it flows naturally from the keyboard because it > types in the direction of the thought process .. no having to invert > thought direction or move the insert cursor backwards.. > > .. on the other hand, the entire question would be irrelevant if i could > get my sw to insert text in backwards order when needed. > You assume that there is a natural flow of thoughts that just needs to be mapped into the language & interface. What if the opposite is the case: that our thought process is governed or at least substantially influenced by conventions established exactly in order to write and read mathematical expressions unequivocally? > ........................................ > quote from > http://www.jsoftware.com/papers/EvalOrder.htm > " > The reasons for choosing 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) . > > 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) or +/(u/x) tend to occur more frequently > than (+/x)×y and (+/u)/x . > > 3. An expression evaluated from right to left is the 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 x⍴x > 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|-/d determines > divisibility by 11 . > " > > On 2011-08-14 07:57, Roger Hui wrote: >> http://www.jsoftware.com/papers/EvalOrder.htm >> >> K.E. Iverson, >> Appendix A, Conventions Governing Order of Evaluation, >> Elementary Functions: An Algorithmic Treatment, >> Science Research Associates, 1966. >> >> >> >> ----- Original Message ----- >> From: mijj<[email protected]> >> Date: Saturday, August 13, 2011 20:07 >> Subject: Re: [Jchat] Fibonacci Sequence >> To: Chat forum<[email protected]> >> >>> interesting that Fibonacci was a significant in spreading the >>> arabic >>> number system in europe .. but the number order wasn't reversed >>> to >>> account for our writing in the other direction ... thus the >>> reason we >>> all write numbers backwards. >>> >>> .. plus .. while on the subject of direction .. why was APL thus >>> J >>> direction of evaluation set to be right to left? .. wouldn't >>> it'd be >>> more natural as left to right? (ie. the same direction as >>> writing, or >>> the direction which represents the progression of time) >>> >>> On 2011-08-13 20:25, Joey K Tuttle wrote: >>>> A friend pointed me to an NPR audio segment - >>>> >>>> >>> http://www.sciencefriday.com/program/archives/201108124> >>>> Which is an author interview, abstract - >>>> >>>> How Leonardo of Pisa, aka Fibonacci, Introduced The World To Numbers >>>> >>>> To carry out their calculations, merchants in the early 13th century >>>> used an abacus or a system called finger reckoning. Commerce changed >>>> when Leonardo of Pisa -- known today as Fibonacci -- published the >>>> first arithmetic textbook. Mathematician Keith Devlin talks >>> about the >>>> history of arithmetic and his new book The Man of Numbers: >>>> Fibonacci's Arithmetic Revolution. >>>> >>>> >>>> ~~ >>>> >>>> An interesting remark in the interview is that the sequence we are >>>> fond of was an incidental example among many that Fibonacci >>> used to >>>> stir up interest. >>>> >>>> The talk show hawks the Devlin's new book "The Man of Numbers: >>>> Fibonacci's Arithmetic Revolution" and a companion ebook "Leonardo >>>> and Steve: The Young Genius Who Beat Apple to Market by 800 >>> Years" - >>>> they look interesting, especially the cheap ($3) Kindle book which >>>> purports to be the core content of the longer book. >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- View this message in context: http://old.nabble.com/NuVoc-tp31595228s24193p32275338.html Sent from the J Chat mailing list archive at Nabble.com. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
