Post Reply 
[newRPL] interested in RPN mode?
10-18-2019, 08:54 PM
Post: #7
RE: [newRPL] interested in RPN mode?
(10-18-2019 07:55 PM)rprosperi Wrote:  Would newRPN (w/4-level stack) be only for interactive use, or would normal RPL programming capabilities still apply (it seems they would be extremely hobbled with a 4-stack depth limit)?

Good question, I guess we need to define exactly how this would behave.

The way I see it, I could implement RPN the following way:

* A flag (ok, 2 flags) would determine stack depth: 4-level, 8-level or infinite.
* The execution loop would test the flags, and check after executing each command if the stack has > 4 (or 8) levels and "trim" it, or if it has less it would get the last known "T" value and fill the stack with it to complete the 4/8 levels.
* The UI can be tweaked to make the Enter key behave more like an RPN machine.

This means that internally, existing newRPL commands will make use of the entire memory and infinite stack, but once the command ends, the response will "trim" the stack to 4 levels. For example, if you have a 5 element list and you do OBJ->, you'll get the last 3 elements and the number 5 on the stack (after a "trim" to only 4 values).
But, if you keep the list together, one list (or vector/matrix) takes ONE stack level, also one complex number takes ONE level, not 2 as in the classic RPN machines. So code could make more efficient use of the stack.

Programming would of course be plain RPL, implementing keystroke programming would require a much more detailed reimplementation of commands and UI.
If you are truly nostalgic, just write RPL using [Enter] after each command so it all lines up vertically like in keystroke programs Smile.

In summary, the idea is to have not a completely new calculator called newRPN, but an RPN mode running on the same RPL engine. A couple of flags would allow any user or program to enable/disable RPN mode at will.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [newRPL] interested in RPN mode? - Claudio L. - 10-18-2019 08:54 PM



User(s) browsing this thread: 3 Guest(s)