listsum



Write a function that sums the numbers in a list.


Solution

(define (listsum l)
  (if (null? l)
      0
      (+ (car l) (listsum (cdr l)))))