4 ms·
Yeah, it feels like the whole "why" is that RPN reflects how the machine works, so it's easier to build it that way.
by jeffbee 6y ago
Yeah, it feels like the whole "why" is that RPN reflects how the machine works, so it's easier to build it that way.
- ajarmst 6y agoWell, it’s easier to build because it has a terse syntax that requires fewer symbols, doesn’t need precedence and associativity rules, and has no ambiguous instructions. It’s easier to use for the same reasons.
- tome 6y ago> has no ambiguous instructions Really? What do you call an operator applied to an empty stack? A sequence of commands that leaves the stack non-empty? I don't see why that's any less ambiguous than mismatched parentheses.
- jeffbee 6y agoWhy would any person or machine care that the stack wasn't empty?
- jonsen 6y agoAnd there is actually no such thing as an empty stack on an RPN calculator. A four register stack, as is common, always holds four numbers.
- jonsen 6y ago> A sequence of commands that leaves the stack non-empty? That’s actually a feature. It’s even fundamental in concatenative programming languages such as FORTH and Factor.
- jonsen 6y ago> What do you call an operator applied to an empty stack? [Pi] for example is an operator which can push the value of Pi onto an empty stack.
- what-do-I-know 6y agoIt may be easier to build, but that difference is quite small and not likely something that would have influenced the design of a scientific calculator. Many people have found RPN to be a superior user interface, and that’s likely the “why”.