Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
manual:chapter6:stack:cmd_stkpop [2019/10/09 08:48] claudio |
manual:chapter6:stack:cmd_stkpop [2019/10/19 15:09] jojo1973 |
==== STKPOP ==== | ==== STKPOP ==== |
---- | ---- |
<callout type="primary" color="" icon="fa fa-comment" title="Description"> | <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> |
---- | ---- |
Pop a snapshot from the top of the "stack of stacks" onto the current stack. Current stack contents will be overwritten and lost, and the snapshot will be removed from the "stack of stacks". | Pop a snapshot from the Undo stack onto the current stack |
</callout> | </callout> |
| |
<callout color="crimson" icon="fa fa-indent" title="Stack Diagram"> | <callout color="green" icon="fa fa-indent" title="Stack Diagram"> |
---- | ---- |
^ __Input Stack__ ^ ^ __Output Stack__ ^ | ^ __Input Stack__ ^ ^ __Output Stack__ ^^^ |
| **...** | **→** | **...** | | | | **→** | **O<sub>n</sub>** | **...** | **O<sub>1</sub>** | |
| //N Levels// | **→** | //M Levels// | | | //Level 1// | //→// | //Level n// | //...// | //Level 1// | |
| |
{{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} | {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} |
| |
| {{fa>times?lg&color=red}} **Support for inclusion in symbolic expressions** | | |**Type**| [[manual:chapter5:basics#operators|Command]] || |
| {{fa>times?lg&color=red}} **Support for parallel list processing** | | |**Parallel list processing**| [[manual:chapter5:listproc#group-1commands-that-cannot-parallel-process|Group 1]] || |
| {{fa>times?lg&color=red}} **Affected by flags** | | |**Affected by flags**| None || |
</callout> | </callout> |
| |
<callout type="warning" icon="fa fa-thumbs-down" title="Compatibility"> | <callout color="orangered" icon="fa fa-comment" title="Description"> |
---- | ---- |
This command is new in newRPL, does not exist in userRPL. | The ''STKPOP'' command clears current stack and replaces it with a snapshot recalled from the top of the Undo stack. Subsequently the snapshot is removed from the Undo stack and all remaining snapshots drop one place. |
| |
| The command has little utility in interactive mode, since each time a command is typed and [[manual:chapter6:operators:cmd_ovr_xeq|XEQ]]ted a snapshot of the stack is already pushed on the Undo stack: the only effect of ''STKPOP'' would be to overwrite the current stack with a snapshot of itself. |
| </callout> |
| |
| <callout type="danger" icon="true" title="Compatibility"> |
| ---- |
| This command is new in newRPL and does not exist in userRPL. |
</callout> | </callout> |
| |
<callout type="info" icon="true" title="Usage"> | <callout type="info" icon="true" title="Usage"> |
---- | ---- |
The following program: | The following program |
<code> | <code> |
« 123 | « 123 |
» | » |
</code> | </code> |
the numbers 123, 456, 789 will appear on the stack, while the 999 is lost when ''STKPOP'' restores the snapshot. | creates the following stack (before ''STKPOP'' is executed): |
| <code> |
| 1: 999 |
| …………………………………………………………………………………… |
| </code> |
| The effect of ''STKPOP'' is to replace it with |
| <code> |
| 3: 123 |
| 2: 456 |
| 1: 789 |
| …………………………………………………………………………………… |
| </code> |
</callout> | </callout> |
| |
<callout color="darkslategray" icon="fa fa-hand-o-right" title="Related Commands"> | <callout color="darkgray" icon="fa fa-hand-o-right" title="Related Commands"> |
| ---- |
{{page>manual:chapter6:stack&nofooter&noeditbtn&inline}} | {{page>manual:chapter6:stack&nofooter&noeditbtn&inline}} |
</callout> | </callout> |