Queue/Usage: Difference between revisions

→‎{{header|Ruby}}: add demo of built-in class
(add lambdatalk code)
(→‎{{header|Ruby}}: add demo of built-in class)
Line 2,821:
 
=={{header|Ruby}}==
Sample usage at [[FIFO#Ruby]].<p>
Or use the built-in Queue class:
 
<syntaxhighlight lang="ruby">q = Queue.new
q.push "Hello" # .enq is an alias
q.push "world"
p q.pop # .deq is an alias
p q.empty? # => false
</syntaxhighlight>
 
=={{header|Rust}}==
1,149

edits