Tony Duell wrote:
My (considered?) opinion is that it's
certainly a postfix machine in
that
you enter both numbers into Y and X before doing
an arithmetic
operation.
But becuase of the lack of automatic stack
operation, it's not an RPN
machine?
Isn't use of postfix operations the defining characteristic of Reverse
Polish Notation, since Polish Notation used prefix operations?
That is exactly my point/question.
My view is that while postfix operators are necessary condition for
soemthing being RPN, they are not a sufficient one.
Suppose we take the simple exression (12+15)*(13+234). In what I think of
as 'pure RPN', as used in languages like Forth, Postscript RPL[1], etc,
tjat becomes something of the form
12# 15# + 13# 234# + *, where '#' is a symbol to terminate number, often
just a space. HP's 4-level stack RPN as used on the HP35,etc is almost
'pure', it has some oddities (regarding the limited stack size ans the
'stack lift'), but it still works genrally as you'd expect.
[1] IMHO anyone who claims RPL is not RPN doesn't undertand what RPN
actually is!
But on the 3 level stack machines, the 9100 and 9810, that expressiob
becomes something like :
12 <up> 15 + (The result of that is now in Y)
13 <up> 234 + (the first result is now in Z, the second result in Y)
<down> *
It's that exrra <down> that bothers me. I feel that true RPN should
automaticallty drop, that results should go on top of stack, and so on.
[..]
To implement fully general postfix notation would
require an infinitely
deep stack, while calculators prior to the HP-28C only had a small fixed
number of stack levels. This didn't stop them from being considered
postfix or RPN.
THey are cerytainly postfix. As I said abovem, I don;t consider them to
be totally 'pure' RPN, becuase of the limited stack size, and the fact
that sometimes numebr entrie overwrite top-of-stack, sometimes it pushes
the stack. I can understnad why this was done, BTW, and genrally, apart
from the limit on stack size, a 4-level HP RPN machine
behaves as I would
expect an RPN machine to behave (the RPL machines _always_ seem
to :-)).
But the 3-level machines have rather more deviations from what I consider
to be RPN.
-tony