2over
Input Stack:
|
⇨ | Output Stack:
|
Copy both items from the stack and place copies on top. This operator provides a convenient
way to duplicate both items on a two-item stack. It's equivalent to the sequence :over,:over
but more clearly expresses the intent to copy both items.
Parameters¶
- top: The item on top of the stack (will be copied)
- second: The second item from the top (will be copied)
Examples¶
Copying two items from deeper stack positions:
a,b,:2over
Pos | Input | Output |
---|---|---|
0 | b | b |
1 | a | a |
2 | b | |
3 | a |
Equivalent Sequence¶
The :2over
operation is exactly equivalent to:
:over,:over
Both sequences produce the same result, but :2over
is more concise and clearly indicates
the intent to copy two items from deeper positions.