Ingvar Mattsson <ingvar@cathouse.bofh.se> wrote:
+---------------
| (defun test-adder ()
| (let ((f1 (make-adder 3))
| (f2 (make-adder 7)))
| (list (apply f1 2) (apply f2 2) (apply f1 5) (apply f2 5))))
+---------------
Typo? I think you meant one of the following alternatives, yes?
(defun test-adder ()
(let ((f1 (make-adder 3))
(f2 (make-adder 7)))
(list (funcall f1 2) (funcall f2 2)
(funcall f1 5) (funcall f2 5))))
(defun test-adder ()
(let ((f1 (make-adder 3))
(f2 (make-adder 7)))
(list (apply f1 2 '()) (apply f2 2 '())
(apply f1 5 '()) (apply f2 5 '()))))
(defun test-adder ()
(let ((f1 (make-adder 3))
(f2 (make-adder 7)))
(list (apply f1 '(2)) (apply f2 '(2))
(apply f1 '(5)) (apply f2 '(5)))))
-Rob
-----
Rob Warnock, PP-ASEL-IA <rpw3@rpw3.org>
627 26th Avenue <URL:http://www.rpw3.org/>
San Mateo, CA 94403 (650)572-2607