33 lines
741 B
Plaintext
33 lines
741 B
Plaintext
( ( stack
|
|
= (S=)
|
|
(push=.(!arg.!(its.S)):?(its.S))
|
|
( pop
|
|
= top.!(its.S):(%?top.?(its.S))&!top
|
|
)
|
|
(top=top.!(its.S):(%?top.?)&!top)
|
|
(empty=.!(its.S):)
|
|
)
|
|
& new$stack:?Stack
|
|
& (Stack..push)$(2*a)
|
|
& (Stack..push)$pi
|
|
& (Stack..push)$
|
|
& (Stack..push)$"to be or"
|
|
& (Stack..push)$"not to be"
|
|
& out$((Stack..pop)$|"Cannot pop (a)")
|
|
& out$((Stack..top)$|"Cannot pop (b)")
|
|
& out$((Stack..pop)$|"Cannot pop (c)")
|
|
& out$((Stack..pop)$|"Cannot pop (d)")
|
|
& out$((Stack..pop)$|"Cannot pop (e)")
|
|
& out$((Stack..pop)$|"Cannot pop (f)")
|
|
& out$((Stack..pop)$|"Cannot pop (g)")
|
|
& out$((Stack..pop)$|"Cannot pop (h)")
|
|
& out
|
|
$ ( str
|
|
$ ( "Stack is "
|
|
((Stack..empty)$&|not)
|
|
" empty"
|
|
)
|
|
)
|
|
&
|
|
);
|