3 [sicp [ch2-2 :only (accumulate)]]))
5 ;; (define (accumulate-n op init seqs)
6 ;; (if (null? (car seqs))
8 ;; (cons (accumulate op init <??>)
9 ;; (accumulate-n op init <??>))))
10 (defn accumulate-n [op init seqs]
11 (if (nil? (first seqs))
13 (cons (accumulate op init (map first seqs))
14 (accumulate-n op init (map next seqs)))))
16 (deftest test-accumulate-n
17 (let [s (list (list 1 2 3) (list 4 5 6) (list 7 8 9) (list 10 11 12))]
18 (is [= (accumulate-n + 0 s)