; defines an object that fits the stack ADT ; usage: (new), (top), (push it), (pop), ... (let ((stack nil)) ; local variable holds the stack (defun new () (setq stack nil)) ; defun functions have global scope (defun top () (car stack)) (defun push (item) (setq stack (cons item stack))) (defun pop () (setq stack (cdr stack))) (defun empty () (null stack)) )