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, 08:43 AM
Post: #4
RE: What to do with stack overflow OBJ->/LIST->?
(06-21-2016 01:57 AM)Claudio L. Wrote:  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?

Currently, the 128th item silently disappears off the top of the stack. My first thought was, "Well, that's not good." My second thought was, "You know, that's what the 41C did, and it only had 4!"

I do recall once writing a 50g program that temporarily put a BUNCH of items on the stack, but that was in a program. Am I correct that on the Prime, OBJ-> would be for interactive use only? If so, 128 is quite large for interactive use. I suspect it would be exceedingly rare for anyone to interactively bump up against the 128 limit.

As long as the limit is documented, then I don't see a problem with items dropping off the top of the stack.

Any reason why the stack is limited to 128? Would it be easier to increase the limit, say 1024, or put in error trapping code?
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->? - Wes Loewer - 06-21-2016 08:43 AM



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