stack Module

clear-stack

a

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.

getstack

getstack get-stack

See get-stack.

get-stack

(a*)

Puts a quotation containing the contents of the stack on the stack.

id

Does nothing.

keep

a1 quot a* a1

Removes the first element from the stack, dequotes it, and restores the second 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.

setstack

setstack set-stack

See set-stack.

set-stack

quot a*

Substitute the existing stack with the contents of quot.

sip

quot1 quot2 a* quot1

Saves the quot1, dequotes quot2, and restores quot1.

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.