Re: Four-Level RPN and the Real World Message #14 Posted by Marcel Samek on 13 Dec 2013, 2:29 p.m., in response to message #1 by Matt Agajanian
If I am just evaluating an equation and entering values in as necessary, then a 4 level stack can be sufficient for quite complex equations. However, if I enter values that are then reused in the equation multiple times, it is a different story.
In the first case, you are using the RPN stack to perform operations and hold intermediate results, which it is well designed for, is efficient and elegant.
In the second case you are using the stack to juggle input data as well as perform operations and hold intermediate results and that can cause a lot of grief, depending on the number of input variables and where in the equation they happen to be (re)used.
I find that a lot of stack manipulation and use of registers happens not because of the complexity of an equation, but because of the desire to move data around to put it into place for the equation. I think of those as unrelated problems.
|