[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: address@hidden, address@hidden*Subject*: Re: various recent ll1 threads*From*: Guy Steele - Sun Microsystems Labs <address@hidden>*Date*: Tue, 28 May 2002 12:51:41 -0400 (EDT)*Cc*: address@hidden, address@hidden*Reply-to*: Guy Steele - Sun Microsystems Labs <address@hidden>*Sender*: address@hidden

Date: Tue, 28 May 2002 12:26:02 -0400 X-Authentication-Warning: everest.ascent.com: sundar set sender to sundar@everest using -f From: Sundar Narasimhan <sundar@ascent.com> To: a.schmolck@gmx.net CC: ll1-discuss@ai.mit.edu, Guy.Steele@sun.com Subject: Re: various recent ll1 threads > Interesting points, but contemplate > > / * - 2 3 > + 4 1 > + 11 3 > > or, with Lisp's parentheses, > > > (/ (* (- 2 3) > (+ 4 1)) > (+ 11 3)) > > In this case each operator tends to be quite close to its children. > If all you care about is "separation", then each operator is > separated from its first child by zero tokens and from its > second child by one token (because you scan horizontally > over to the first child, then vertically to the second child, > which may be some distance down but there will be no tokens > in the way!). > > This two-dimensional effect is difficult to achoeve with infix. This is really interesting -- I've always thought that the main advantage of the classical mathematical notation is likely to be that it allows (by virtue of its irregularity) to build visually rich two dimensional structures, which I assume must be more congenial to the workings of our visual system. Although it was clear to me that this advantage doesn't transfer well into ASCII, it didn't occur to me that it might actually loose out in this respect to prefix (the above example also seems to demonstrate, however, that parens are a problem -- the parenless version is definitely easier to read). Which brings me onto the next question -- has someone come up with a more visual prefix-based notation for math that isn't "flat", has implicit operators (e.g. in LaTeX notation ^{2}3 rather than 3^{2}) etc.? alex > > Yes, infix may win for small expressions. Years of experience > have convinced me what prefix wins for large expressions. > > --Guy Steele The finished product is easier to contemplate the way Guy has written the above of course, but what one needs to 'manipulate' is often different from what one needs to express the finished product -- in this case the arithmetic expression. Guy, do you realy 'work' in prefix while deriving equations like the above? I have never met a mathematician who used prefix for their calculations. On the blackboard, using only + - / * expt sqrt, the answer is "no". In an Emacs buffer, the answer is "yes", I do often use prefix form for manipulation and generating expression derivations for proofs. This may reflect the fact that Emacs has better tools for marking, deleting, copying, and moving past prefix expressions than for infix expressions. I am sufficiently used to reading mathematical expressions in both infix and Lisp forms that sometimes I don't find myself consciously distinguishing them. For example, several weeks ago someone sent me some email containing the expression "(+ (* b b) (* 4 a c))" and my mind merely said, "Ah, yes, the quadratic discriminant"; when I re-read the email the next day, I was actually surprised to see it was in prefix form, because I had "misremembered" its content as "b*b - 4*a*c". On the blackboard I use a wild variety of notations, and often scribble a hodgepodge of Java, Lisp, APL, regular expressions, and mathematical notation---whatever seems most convenient at the time. --Guy Steele

**Follow-Ups**:**RE: various recent ll1 threads***From:*"Anton van Straaten" <anton@appsolutions.com>

- Prev by Date:
**Re: various recent ll1 threads** - Next by Date:
**RE: various recent ll1 threads** - Previous by thread:
**Re: various recent ll1 threads** - Next by thread:
**RE: various recent ll1 threads** - Index(es):