Queue/Usage: Difference between revisions
Content added Content deleted
(→{{header|JavaScript}}: must use built-in objects (Array) for this task) |
(Added Oz.) |
||
Line 463: | Line 463: | ||
# Queue.is_empty q;; |
# Queue.is_empty q;; |
||
- : bool = true</lang> |
- : bool = true</lang> |
||
=={{header|Oz}}== |
|||
<lang oz>declare |
|||
[Queue] = {Link ['x-oz://system/adt/Queue.ozf']} |
|||
MyQueue = {Queue.new} |
|||
in |
|||
{MyQueue.isEmpty} = true |
|||
{MyQueue.put foo} |
|||
{MyQueue.put bar} |
|||
{MyQueue.put baz} |
|||
{MyQueue.isEmpty} = false |
|||
{Show {MyQueue.get}} %% foo |
|||
{Show {MyQueue.get}} %% bar |
|||
{Show {MyQueue.get}} %% baz</lang> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
Perl has built-in support to these operations: |
Perl has built-in support to these operations: |