7.6 Stacks

Stacks can be easily implemented by using cells and lists. Therefore, they are not directely provided by the Oz base environment. The type of a stack object is:

unit(push   : value : -> 
     pop    : -> value
     put    : value -> 
     get    : -> value
     top    : -> value
     size   : -> int
     isEmpty: -> bool
     clear  : -> 
     toList : -> list
     ... )



Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)