plushi.state
Functions to manipulate push states. Push states are composed of one stack
per supported data type, a string representing stdout, and a vector where
input values can be staged.
assoc-item
(assoc-item state stack-type position value)
Retuns a copy of the state where the value at the specified position in the
specified stack is replaced with the given value.
flush-stack
(flush-stack state stack-type)
Returns a copy of the state with the specified stack emptied.
insert-item
(insert-item state stack-type position value)
Returns a copy of the state with the valued inserted into the specified stack
at the specified position. If the position is beyond the
new-state
(new-state stack-types)
Returns a new empty state based on a collections of stack types.
nth-item
(nth-item state stack-type position)
Returns the item at a certain position (aka depth) of the type stack in
state. Returns :no-stack-item if called on an empty stack, or out of bounds.
pop-item
(pop-item state stack-type)
Returns a copy of the state with the specified stack popped.
pretty-print
(pretty-print state)
Prints a push state in a human-friendly way.
push-item
(push-item state stack-type value)
Returns a copy of the state with the value pushed on the named stack.
top-item
(top-item state stack-type)
Returns the top item of the type stack in state. Returns :NO-STACK-ITEM if
called on an empty stack.