Next: , Previous: , Up: stacks   [Index]


36.3 Stack accessors and mutators

The following syntactic bindings are exported by the library (vicare containers stacks). The syntactic bindings whose name is prefixed with $ are unsafe operations: they do not validate their arguments before accessing them.

Function: stack-top stack
Function: $stack-top stack

Return the object at the top of the stack. Raise an assertion violation if stack is empty.

Function: stack-push! stack obj
Function: $stack-push! stack obj

Push obj on the top of the stack.

Function: stack-pop! stack
Function: $stack-pop! stack

Remove the object at the top of the stack and return it. Raise an assertion violation if stack is empty.

Function: stack-purge! stack
Function: $stack-purge! stack

Remove all the elements from stack.