Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!rutgers!super.upenn.edu!linc.cis.upenn.edu!sherin From: sherin@linc.cis.upenn.edu (Steve Sherin) Newsgroups: comp.lang.lisp Subject: scoops example: stacks Message-ID: <1229@super.upenn.edu.upenn.edu> Date: Sun, 24-May-87 01:51:08 EDT Article-I.D.: super.1229 Posted: Sun May 24 01:51:08 1987 Date-Received: Sun, 24-May-87 08:37:14 EDT Sender: root@super.upenn.edu.upenn.edu Reply-To: sherin@linc.cis.upenn.edu.UUCP (Steve Sherin) Distribution: world Organization: University of Pennsylvania Lines: 17 ;;; Stacks with Scoops--Steve Sherin (define-class stack (instvars the-stack) (options inittable-variables gettable-variables settable-variables)) (define-method (stack push) (value) (set! the-stack (cons value the-stack))) (define-method (stack tos) () (if the-stack (car the-stack))) (define-method (stack pop) () (if the-stack (let ((top (tos))) (set! the-stack (cdr the-stack)) top)))