That's not going to work if each word is evaluated independently of it
context. After "20 b", the stack is going to contain 20 and the *value*
of b; the "=" doesn't have a reference to the *variable* b to work with.
C resolves this by treating an object name as an lvalue, and converting
it to an rvalue (taking its stored value) depending on the context.
I have my own RPN calculator; it uses "b" to push the value of b on the
stack, and "b=" as a single word to assign the value on top of the stack
to b.
Another approach would be to use a special syntax to push the name of a
variable onto the stack rather than its value, for example letting "b"
push the current value of b and ".b" push the name of b. Then "=" would
require the top stack item to be a name, not a value.
--
Keith Thompson (The_Other_Keith)
ks...@mib.org <
http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"