;; a list-of-number is either ;; empty, or ;; (cons number list-of-number) ;; sum-list: list-of-number -> number ;; consumes a list of numbers and produces the sum of the numbers in the list (define (sum-list alon) (cond [(empty? alon) 0] [(cons? alon) (+ (first alon) (sum-list (rest alon)))])) (check-expect (sum-list empty) 0) (check-expect (sum-list (cons 3 empty)) 3) (check-expect (sum-list (cons 5 (cons 2 (cons 9 empty)))) 16)