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

*To*: address@hidden*Subject*: infix notation [Re: Macros and little languages]*From*: Dave Long <address@hidden>*Date*: Fri, 24 May 2002 20:17:48 -0700*In-reply-to*: Message from Paul Graham <pg@archub.org> of "24 May 2002 23:15:51 -0000." <20020524231551.35859.qmail@mail.archub.org>*Sender*: address@hidden

> In technology, you've got to > watch out for choosing custom over something that actually > works better. That's why HP scientific calculators use > postfix. A side discussion (which I believe was partly inspired by Arc) led me to find the following mathematical argument for infix notation; it may be more than a simple matter of custom. -Dave EWD1300: > A little hesitance was induced when my late colleague Wouter Peremans > remarked in passing that infix notation was of course "a notational > relic". It made me realize why I like it so much for associative > operators: it allows us to write p+q+r without being forced to choose > between (p+q)+r and p+(q+r); in prefix notation, the choice between > ++pqr and +p+qr would have been unavoidable. > > [EWD249: Programming (or problem solving in general?) as the judicious > postponement of decisions and commitments] > > The main reason to stick to the infix notation for the usual > operators was, of course, that we all are so terribly used to it, > but the associativity does play an honest role: I did introduce -- > with great satisfaction! -- infix operators for what I used to denote > by max(x,y) and gcd(x,y), and find that I don't introduce anymore > infix operators that are not associative.

**Follow-Ups**:**infix notation [Re: Macros and little languages]***From:*Shriram Krishnamurthi <sk@cs.brown.edu>

**References**:**Re: Macros and little languages***From:*Paul Graham <pg@archub.org>

- Prev by Date:
**Re: Accumulator** - Next by Date:
**infix notation [Re: Macros and little languages]** - Previous by thread:
**Re: Macros and little languages** - Next by thread:
**infix notation [Re: Macros and little languages]** - Index(es):