Post Reply 
[34S] Proposal for Entry RPN mode with dynamic stack
02-18-2015, 01:03 AM
Post: #28
RE: [34S] Proposal for Entry RPN mode with dynamic stack
(02-15-2015 10:28 PM)matthiaspaul Wrote:  Regarding stack manipulation commands, I think, they should continue to work as before, except for [c]R^ and [c]Rv, which either should work on the whole dynamically stack, or better new [c]ROLL^ and [c]ROLLv commands would have to be added in order to provide the facility to work on the whole stack instead of the base stack ([c]R^/v aka ROT) only.
I meanwhile have come to the conclusion that it makes sense to let the [c]Rv and [c]R^ commands continue to work on the 4- or 8-level base stack only, even if a dynamic stack exists. These stack operations are frequently used to rearrange the "local" stack environment to bring the arguments in the desired order for following operations. Many people may have memorized specific key sequences to carry out certain stack tricks. Also, the dynamic stack isn't guaranteed to exists, so it can be "dangerous" to roll recent stack contents into it. So, [c]ROLL^ and [c]ROLLv operations working on the whole stack (including the dynamic stack) are needed in addition to [c]R^ and [c]Rv.

In addition to clearing the 4- or 8-level stack registers with 0, CLSTK would deallocate the dynamic stack. The behaviour of FILL would depend on if (with the dynamic stack enabled) we'd continue to support the T duplication feature or not: With the T duplication feature disabled, FILL would attempt to grow the dynamic stack as much as possible and fill the 4- or 8-level stack as well as the dynamic stack with the specified value. (For as long as we allow the dynamic stack to be automatically truncated as soon as re-purposed registers were needed again, growing the stack for FILL would have no negative sideeffects - otherwise, FILL would just work up to the current size of the dynamic stack.) With the T duplication feature enabled, FILL could just as well deallocate the dynamic stack (like CLSTK) and fill the 4- or 8-level base stack with the specified value. DEPTH would return the current effective stacksize (base stack size + dynamic stack size).

In the current layout of the WP 34S, the ROLL^ and ROLLv operations could either overload the [Rv] / [R^] or the [v] / [^] key assignments, when used with prefix [->]. cROLL^ and cROLLv would use the double-prefix [->] [CPX] instead. If [c]ROLL^ / [c]ROLLv would be assigned to [v] / [^], we could use the [->] [CPX] [Rv] / [R^] to roll the effective stack 4 or 8 levels at a time. CLSTK could be assigned to [->] [<-] (or [CPX] [<-]).

Greetings,

Matthias


--
"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [34S] Proposal for Entry RPN mode with dynamic stack - matthiaspaul - 02-18-2015 01:03 AM



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