manual:chapter6:stack:cmd_stkdrop


Synopsis


Drop a snapshot from the top of the Undo stack

Stack Diagram


Input Stack Output Stack
Level 1 Level 1

Legend

Type Command
Parallel list processing Group 1
Affected by flags None

Description


The STKDROP command deletes the snapshot on the top of the Undo stack and subsequently all remaining snapshots drop one place.

The command has little utility in interactive mode, because before STKDROP is executed a snapshot of the stack is pushed on the Undo stack: the only effect of STKDROP would be to delete the copy that was just made, leaving the Undo stack unchanged (except for the fact that its level 8 would have been lost in the process).

Compatibility


This command is new in newRPL and does not exist in userRPL.

Usage


The following program

« "ABC"
  STKPUSH
  CLEAR
  123
  456
  789
  STKPUSH
  CLEAR
  999
  STKDROP
  STKPOP
»

creates the following stack (before STKDROP is executed)

1:                           999
……………………………………………………………………………………

The effect of STKPOP is to replace it with

 
1:                         "ABC"
……………………………………………………………………………………

Related Commands


Stack manipulation 27 5 NEW

Command Short Description
CLEAR Remove all objects from the stack
DEPTH Get the current stack depth
DROP Remove an object from the stack
DROP2 Remove two objects form the stack
DROPN Remove N objects from the stack
DUP Duplicate an object on the stack
DUP2 Duplicate two objects on the stack
DUPDUP Duplicate the same object twice on the stack
DUPN Duplicate a group of N objects
NDUPN Replicate one object N times and return N
NIP Remove object at level 2 on the stack
OVER Duplicate object at level 2 on the stack
PICK Duplicate object at position N on the stack
PICK3 Duplicate object at level 3 on the stack
ROLL Move object at level N to level 1
ROLLD Move object from level 1 to level N
ROT Move object from level 3 to level 1
SWAP Exchange objects in levels 1 and 2
UNPICK Move object from level 1 to level N.
UNROT Move object from level 1 to level 3
IFT Evaluate objects on the stack conditionally
IFTE Evaluate objects on the stack conditionally
STKPUSH Push a snapshot of the current stack on the undo stack NEW
STKPOP Pop a stack snapshot from the undo stack NEW
STKDROP Drop a snapshot from the undo stack NEW
STKPICK Copy snapshot in level N to the current stack NEW
STKDEPTH Get the depth of the undo stack NEW
  • manual/chapter6/stack/cmd_stkdrop.txt
  • Last modified: 2019/11/03 15:17
  • by jojo1973