; Can you abstract these two functions into an accumulator?
; ------------------------------
; The Little Lisper 3rd Edition
; Chapter 9
; Exercise 6
; Common Lisp
; http://t...content-available-to-author-only...r.com/thelittlelisper
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper-chapter-9-lamdba-ultimate.html
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper.html
; ------------------------------

; assume addvec is the text and multivec is the exercise from chapter 5

(defun accum ( func terminator lat)
  (cond
   ((null lat) terminator)
   (t (funcall func (car lat)
               (accum func terminator (cdr lat))))))

(print (accum '+ 0 '(1 2 3 4 5 6) ))
;21

(print (accum '* 1 '(1 2 3 4 5 6) ))
;720
