Post Reply 
Little explorations with HP calculators (no Prime)
05-28-2019, 11:09 AM (This post was last modified: 05-28-2019 11:11 AM by 3298.)
Post: #353
RE: Little explorations with HP calculators (no Prime)
With UserRPL you're most likely stuck with DEPTH \->LIST 'varname' STO for saving and 'varname' RCL OBJ\-> DROP for restoring the stack. \->LIST is indeed a bottleneck here due to all the copying it does, though STOring large objects into global variables does some copying too. (On the other hand, moving things into globals gets them out of the way of the garbage collector, which can shave off a few seconds in later parts of the program. I think that's been mentioned in one of your threads already.)

SysRPL gives you more tools though, including the Virtual Stack (pretty much a stack of stacks). This allows you to not only save and restore parts of or the entirety of your stack, but it also grants some limited access (can't change the number of items, basically) to the contents of saved stacks. You can simply ask for the n-th level of the most recent saved stack, or even overwrite that spot with something else. This is sometimes employed in place of complex stackrobatics e.g. when so-called "meta objects" (a series of objects followed by their count, for instance an exploded list) are involved.

Come to SysRPL, we have all the awesome toys. Wink
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Little explorations with HP calculators (no Prime) - 3298 - 05-28-2019 11:09 AM

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