Wolf Wejgaard
unread,Jul 14, 2015, 9:59:24 AM7/14/15You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Why are Forth programmers so shy about postfix? E.g.: In the thread about Chuck's TEDx talk Dirk writes:
> Great to read his explanation:
>>"Lisp has a prefix notation, which would be + A B with the operator coming first. Forth is postfix notation when you have A B +."
>People complain about Forth' postfix notation, but it is interesting, that Lisp is well known despite it's prefix notation. To me that means, nobody should complain about Forth' postfix. He should take a look at Lisp.
Of course, but: Postfix runs deeper, postfix is fundamental, postfix is the way things are done in reality. In real life (as in arithmetics) you need the operands before you actually can perform the operation.
To add two numbers you write down the numbers first, then add. That is how you learned to perform the addition. Although you were trained to write 22+33, the actual calcuation was probably something like this
22
33 +
--
55
Postfix is often called unnatural, also in this group recently. Better call it 'unfamiliar'. We are educated in infix a+b , but that doesn't make it 'natural'. Nature doesn't care about our ways of operating.
Postfix describes how it is really done. Look into a kitchen. Cooks take/grip the operands (potato and knife, say), then perform the operation. Peel, shale, skin, cut, boil, roast, grill, bake, ... And so do our CPU's. Better set the operands before the operation.
To some postfix makes immediate sense in comparison to algebraic notation. We know by now how to handle 22+33; then what about 22+33*44? There are two answers, so we need additional rules: Operator priority or/and parentheses. In postfix the answer is clear without any more rules: 22 33 + 44 * or 22 33 44 * +. Simple Forth.
Forgive me if you find my message trivial. And enjoy that you got it. Postfix is Reality.
Say it loud.
Wolf Wejgaard