drop
Input Stack:
|
⇨ | Output Stack: |
Remove the item on the top of the stack. This is useful for discarding intermediate results or cleaning up the stack during complex expression building.
Parameters¶
- item: The item on top of the stack to remove (can be any type)
Examples¶
Removing the top item from a stack with multiple items:
a,b,c,:drop
Pos | Input | Output |
---|---|---|
0 | c | b |
1 | b | a |
2 | a |
Attempting to drop from an empty stack results in an error:
:drop
Warning
Throws an exception due to an empty stack.