Poll: What should happen with LIST-> when an overflow happens?
It should not give the LIST-> if an overflow will happen
It should warn the user, then do it
It should just overflow off the top
Something else
[Show Results]
Note: This is a public poll, other users will be able to see what you voted for.
Post Reply 
What to do with stack overflow OBJ->/LIST->?
06-21-2016, 01:57 AM
Post: #2
RE: What to do with stack overflow OBJ->/LIST->?
(06-20-2016 09:30 PM)Tim Wessman Wrote:  In RPN mode on Prime, you have a ->LIST command in the menu stack menu to build a list. (Type 1 2 3 4 5 ENTER, then press UP and click the "Stack" menu screen button). You can move up and build a list.

There is no direct way to get content out of that list with OBJ-> or LIST-> or similar. Please see http://www.hpmuseum.org/forum/thread-6415.html for the most recent discussion.

I'd like to correct this, but would like some feedback. Currently, there is a limit of 128 items in the stack. What should happen if you have too many items in your list that it will overflow the stack and lose items at the top?

Example: You have a list of { 1,2,...999}
Example: You have a list of { 1,2,...126} and already have 10 items in the stack.

All commands should probably throw a "Stack Overflow" error, which the user can catch with an IFERR statement, and which could be disabled via a flag.
It should be handled the exact same way you are handling ALL commands when the stack overflows. If you have 128 items (full stack) and you do a DUP, what happens on current firmware?

Even on the "infinite" stack of the 50g, if you run out of memory you get an out of memory error thrown, same thing would be expected on the Prime. As long as it's consistent and documented, people will work around the stack limitation.
If you have 10 items on the stack, then you expand the first 118 elements of the list, and when trying to push the 119, it would blow with the "stack overflow" error (or if the flag disables it, just overflow and lose the bottom item).
Since the user chooses the flag setting, the user will be fully aware of what happens and the implications of the overflow.

I don't think you have this option in the poll, I bet most people would agree this is the best way to handle it.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: What to do with stack overflow OBJ->/LIST->? - Claudio L. - 06-21-2016 01:57 AM

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