Queue/Usage: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Now uses Queue class from new Wren-queue module.)
(added Quackery)
Line 2,225: Line 2,225:
print my_queue.get() # bar
print my_queue.get() # bar
print my_queue.get() # baz</lang>
print my_queue.get() # baz</lang>

=={{header|Quackery}}==
<lang Quackery>[ [] ] is queue ( --> q )

[ nested join ] is push ( q x --> q )

[ behead ] is pop ( q --> q x )

[ [] = ] is empty? ( q --> b )</lang>
'''Demonstrating operations in Quackery shell:'''
<pre>/O> queue
... 1 push
... $ "two" push
... ' [ 1 2 + echo say "rd" ] push
... say "The queue is " dup empty? not if [ say "not " ] say "empty." cr
... pop echo cr
... pop echo$ cr
... pop do cr
... say "The queue is " empty? not if [ say "not " ] say "empty." cr
...
The queue is not empty.
1
two
3rd
The queue is empty.

Stack empty.</pre>



=={{header|Racket}}==
=={{header|Racket}}==