SICP - Why use accumulate with cons when filter already passes back a list
https://softwareengineering.stackexchange.com/questions/180398
Question
In SICP 2nd Edition section 2.2.3, the authors have the following code:
(define (even-fibs n)
(accumulate cons
nil
(filter even?
(map fib
(enumerate-interval 0 n)))))
My question is why did they use accumulate in this case? Couldn't they have got the same answer from filter without using accumulate?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange