transcendental-lisp/lisp/object/multiple-methods.lisp

7 lines
175 B
Common Lisp
Raw Normal View History

(defun counter-class ()
(let ((counter 0))
(lambda (msg)
(case msg
((:inc) (setq counter (+ counter 1)))
((:dec) (setq counter (- counter 1)))))))