The user types less, the computer does a lot less.
I find it fun to think in RPN.
The user types less, the computer does a lot less.
I find it fun to think in RPN.
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.
That’s actually a feature. It’s even fundamental in concatenative programming languages such as FORTH and Factor.
[Pi] for example is an operator which can push the value of Pi onto an empty stack.
Here’s the code:
https://github.com/ashok-khanna/RPN-31
Here’s the link:
Don't get me wrong, I love RPN and I've had a stream of HP calculators through my college years (synthetic programming on the HP41!), but... they come at a cognitive price. When you see an expression, you have to process the precedence in your mind to find out the most nested expression and start entering from there.
Basically, the calculator is cheating by forcing you to do some of its job.
If you’re just copying existing expressions, you might as well use one of those OCR calculators.
The point is that it takes time.
As much of an RPN fan I am, I am not convinced that the time it takes my brain to identify nested expressions is smaller than the time it would take me to just type the expression left to right on a regular calculator.