Previous: , Up: stacks   [Index]


36.10 Miscellaneous operations on stacks

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-copy! dst-stack src-stack
Function: $stack-copy! dst-stack src-stack

Iterate over all the objects in src-stack, starting from the top side, and push them in the bottom side of dst-stack. This is a shallow copy: the very objects from the source stack are added to the destination stack; if we need to duplicate the objects, we can use the map operation.

The dst-stack argument allows us to build the destination stack with the desired configuration parameters.

Function: stack-reverse! dst-stack src-stack
Function: $stack-reverse! dst-stack src-stack

Iterate over the objects in src-stack, starting from the top side, and push them in the top side of dst-stack. Return dst-stack.

The dst-stack argument allows us to build the destination stack with the desired configuration parameters.