Mike Cifelli
77a341a1a7
Added a class to compute compound interest. An alias for FUNCALL has been added: CALL Refactored some acceptance tests to load code from files.
14 lines
331 B
Common Lisp
14 lines
331 B
Common Lisp
(let ((direction 'up))
|
|
(defun toggle-counter-direction ()
|
|
(setq direction
|
|
(if (eq direction 'up)
|
|
'down
|
|
'up)))
|
|
|
|
(defun counter-class ()
|
|
(let ((counter 0))
|
|
(lambda ()
|
|
(if (eq direction 'up)
|
|
(setq counter (+ counter 1))
|
|
(setq counter (- counter 1)))))))
|