This code (written in Scheme) is a recursive function that returns the sum of a list. The function call underneath it is an example of how it works.

#lang scheme

(define (sumList lst)
  (cond[(empty? lst) 0]
       [else (+ (first lst) (sumList (rest lst)))]))

; call the function
(sumList (list 2 5 6 7 4 5)) ; 29

              Created: September 6, 2014
Completed in full by: Michael Yaworski