Queue/Definition: Difference between revisions

fixed implementation to correspond with original problem
(added Arturo)
(fixed implementation to correspond with original problem)
Line 1,328:
this\items: remove.index this\items 0
return result
]</syntaxhighlight>
]
 
Q: to :queue []
 
push Q 1
push Q 2
push Q 3
 
print ["queue is empty?" empty? Q]
 
print ["popping:" pop Q]
print ["popping:" pop Q]
print ["popping:" pop Q]
 
print ["queue is empty?" empty? Q]</syntaxhighlight>
 
{{out}}
 
<pre>queue is empty? false
popping: 1
popping: 2
popping: 3
queue is empty? true</pre>
 
=={{header|ATS}}==
1,532

edits