declare % our rep is lists, with the top of the stack at the head of the list. fun {NewStack} nil end fun {Push Stk E} E|Stk end fun {Pop E|S ?TopElem} TopElem=E S end fun {IsEmpty Stk} case Stk of _|_ then false else true end end