Stack Operations

Stack operations manipulate the stack in Sporth. At the moment, Sporth has a very small set of stack operations.

In order of usefulness, they are as follows:

dup: duplicates the item on the stack ( a dup -> a a)

swap: swaps the last two items on the stack ( a b swap -> b a )

rot: rotates the third-to-last item on the stack: ( a b c rot -> b c a )


Back