next up previous contents index
Next: Keyed sets Up: Collections Previous: Sorted collections

stack, queue

Stacks and queues are implemented as special interfaces to mutable lists:

In stack.cecil:


template object stack[T]; 
method collection_name(@:stack[`T]):string; 
method push(s@:stack[`T], x:T):void; 
method pop(s@:stack[`T]):T; 
method top(s@:stack[`T]):T; 
method copy(s@:stack[`T]):stack[T]; 
method new_stack[T]():stack[T]; 
Stacks are implemented as special interfaces to mutable lists.

In queue.cecil:


template object queue[T]; 
method collection_name(t@:queue[`T]):string; 
method enqueue(t@:queue[`T], x:T):void; 
method dequeue(t@:queue[`T]):T; 
method dequeue(t@:queue[`T], if_empty:&():T):T; 
method copy(q@:queue[`T]):queue[T]; 
method new_queue[T]():queue[T]; 
Queues are implemented as special interfaces to mutable lists.


next up previous contents index
Next: Keyed sets Up: Collections Previous: Sorted collections

The Cecil project