rex v0.1.0-alpha2 Rex.Stack

Summary

Functions

Drops the top level item from stack

Duplicates top level item on stack

Duplicates the top item over the second one

Rotates top three items

Prints the stack to STDOUT without modifying it

Swaps two top level items on stack

Functions

drop(list)

Drops the top level item from stack

[a, b | s] -> [b | s]

dup(list)

Duplicates top level item on stack.

[a | s] -> [a, a | s]

over(list)

Duplicates the top item over the second one.

[a, b | s] -> [a, b, a | s]

rot(list)

Rotates top three items.

[a, b, c | s] -> [c, b, a | s]

show(stack)

Prints the stack to STDOUT without modifying it.

[a, b | c] -> [a, b | c]

swap(list)

Swaps two top level items on stack.

[a, b | s] -> [b, a | s]