transcendental-lisp/lisp/object/multiple-methods.lisp
Mike Cifelli 77a341a1a7 Add more advanced lisp objects
Added a class to compute compound interest.

An alias for FUNCALL has been added: CALL

Refactored some acceptance tests to load code from files.
2017-03-06 16:52:06 -05:00

7 lines
175 B
Common Lisp

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