Queue/Definition: Difference between revisions

Content added Content deleted
Line 1,290: Line 1,290:
=={{header|ATS}}==
=={{header|ATS}}==


A common theme in these examples is that there is no runtime error for popping from an empty queue. Instead, you simply cannot compile a program that tries to pop from an empty queue. The type of a queue depends on its size, and you will get a type error if that size is zero.
A common theme in these examples is that there is no runtime error for popping from an empty queue. Instead, you simply cannot compile a program that tries to pop from an empty queue. The type of a queue depends on its size, and you will get a type error if that size is not proven to be nonzero.


=== A linear linked list as a queue ===
=== A linear linked list as a queue ===