RosettaCodeData/Task/Queue-Definition/Phixmonti/queue-definition.phixmonti
2023-07-01 13:44:08 -04:00

23 lines
306 B
Text

include ..\Utilitys.pmt
def push /# l i -- l&i #/
0 put
enddef
def empty? /# l -- flag #/
len 0 ==
enddef
def pop /# l -- l-1 #/
empty? if
"Empty"
else
head swap tail nip swap
endif
enddef
( ) /# empty queue #/
1 push 2 push 3 push
pop ? pop ? pop ? pop ?