RosettaCodeData/Task/Queue-Definition/Klingphix/queue-definition.klingphix

27 lines
320 B
Plaintext

{ include ..\Utilitys.tlhy }
"..\Utilitys.tlhy" load
:push! { l i -- l&i }
0 put
;
:empty? { l -- flag }
len not { len 0 equal }
;
:pop! { l -- l-1 }
empty? (
["Empty"]
[pop swap]
) if
;
( ) { empty queue }
1 push! 2 push! 3 push!
pop! ? pop! ? pop! ? pop! ?
"End " input