(lispkit stack)
Library (lispkit stack)
provides an implementation for mutable stacks, i.e. mutable LIFO buffers.
Symbol representing the stack
type. The type-for
procedure of library (lispkit type)
returns this symbol for all stack objects.
Returns a new empty stack.
Returns a new stack with x on its top position followed by the remaining parameters.
Returns #t
if obj is a stack; otherwise #f
is returned.
Returns #t
if stack s is empty.
Returns the size of stack s, i.e. the number of elements buffered in s.
Returns #t
if stack s1 has the exact same elements in the same order like stack s2; otherwise, #f
is returned.
Pushes element x onto stack s.
Returns the top element of stack s. If the stack is empty, an error is raised.
Removes the top element from stack s and returns its value.
Removes all elements from stack s.
Returns a copy of stack s.
Returns a list consisting of all elements on stack s in the order they appear, i.e. starting with the top element.
Returns a new stack consisting of the elements of list l. The first element in l will become the top element of the stack that is returned.
Pushes the elements of list l onto stack s in reverse order.
Last updated