commit | 484295de5bdc18ee5fb59ffebe2d89a647a5f225 | [log] [tgz] |
---|---|---|
author | swissChili <swisschili@fastmail.com> | Fri Jul 09 21:25:55 2021 -0700 |
committer | swissChili <swisschili@fastmail.com> | Fri Jul 09 21:25:55 2021 -0700 |
tree | b2ce5c06c6b4dbd260b8753c1cf9e54eeaecd1c1 | |
parent | 7e1393c8f962e222d61a84f4f78e30ce028dc45b [diff] [blame] |
Add reduce Broken
diff --git a/src/lisp/test-closures.lisp b/src/lisp/test-closures.lisp index 573024d..39bb134 100644 --- a/src/lisp/test-closures.lisp +++ b/src/lisp/test-closures.lisp
@@ -1,12 +1,5 @@ -(defun mapcar (func list) - (if list - (cons (apply func (list (car list))) - (mapcar func (cdr list))) - nil)) - -(defun double (n) - (+ n n)) - (defun main () - (print (mapcar #'double - (list 1 2 3 4 5)))) + (print (reduce (lambda (a b) + (+ a b)) + (list 1 2 3 4 5) + 0)))