stack Module

clear-stack

Empties the stack.

cleave

a1 (quot*) a*

Applies each quotation contained in the first element to the second element a1.

cons

a1 (a*) (a1 a*)

Prepends a1 to the quotation on top of the stack.

dip

a1 (a2) a* a1

Removes the first and second element from the stack, dequotes the first element, and restores the second element.

dup

a1 a1 a1

Duplicates the first element on the stack.

get-stack

(a*)

Returns a quotation containing the contents of the stack.

id

Does nothing.

keep

a1 quot a* a1

Applies each quotation contained in the first element to each subsequent corresponding element.

nip

a1 a2 a2

Removes the second element from the stack.

over

a1 a2 a1 a2 a1

Pushes a copy of the second element on top of the stack.

pick

a1 a2 a3 a1 a2 a3 a1

Pushes a copy of the third element on top of the stack.

pop

a

Removes the first element from the stack.

rolldown

a1 a2 a3 a2 a3 a1

Moves the third element in first position, the second in third position and the the first in second position.

rollup

a1 a2 a3 a3 a2 a1

Moves the third and second element into second and third position and moves the first element into third position.

set-stack

quot a*

Substitute the existing stack with the contents of quot.

sip

a1 (a2) a* a1

Saves the a1, dequotes a2, and restores a1.

spread

a* (quot*) a*

Applies each quotation contained in the first element to each subsequent corresponding element.

swap

a1 a2 a2 a1

Swaps the first two elements on the stack.

swons

(a*) a1 (a1 a*)

Prepends a1 to the quotation that follows it.