HP 48G - Edit List
|
08-23-2021, 09:41 PM
Post: #7
|
|||
|
|||
RE: HP 48G - Edit List
(08-23-2021 03:13 AM)DavidM Wrote: That said, DEPTH is still very useful. The internal version of the DEPTH command is likely to be one of the most used segments of code in an RPL calculator, since pretty much every UserRPL command does an initial check of the stack depth to make sure that at least the correct number of arguments exists prior to execution. This is part of the normal structure of SysRPL code. I've rarely seen User RPL code designed to do an initial check for argument counts (and/or types), but DEPTH could be used for that purpose. I'm not advocating for people to write User RPL code in that way, mind you, just saying that it could be done. The fact that built-in commands always do this for you means that it isn't as important to do it yourself. That is indeed a clever method, consider it stolen! For programs like that, I have generally maintained a counter on level 1 and SWAP objects above the counter as they occur, then increment the counter. At the end, \->LIST puts all of the objects into a list. Your method is undoubtedly faster since it avoids all of the swapping and incrementing. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP 48G - Edit List - MNH - 08-22-2021, 03:40 AM
RE: HP 48G - Edit List - John Keith - 08-22-2021, 03:02 PM
RE: HP 48G - Edit List - MNH - 08-23-2021, 12:02 AM
RE: HP 48G - Edit List - John Keith - 08-23-2021, 12:52 AM
RE: HP 48G - Edit List - DavidM - 08-23-2021, 03:13 AM
RE: HP 48G - Edit List - John Keith - 08-23-2021 09:41 PM
RE: HP 48G - Edit List - John Keith - 08-23-2021, 01:13 AM
|
User(s) browsing this thread: 1 Guest(s)