Queue/Usage: Difference between revisions

m
imported>Arakov
imported>Arakov
Line 1,192:
var queue := new Queue();
queue.push:(1);
queue.push:(3);
queue.push:(5);
// "Pop" items from the queue in FIFO order
Line 1,206:
// If we try to pop from an empty queue, an exception
// is thrown.
queue.pop() \\ on::(e){ console.writeLine:("Queue empty.") }
}</syntaxhighlight>
 
Anonymous user