Search found 1 match

by griffinish
Sat Apr 17, 2010 9:07 pm
Forum: Scheme
Topic: Need help with a function in DrScheme
Replies: 1
Views: 7360

Re: Need help with a function in DrScheme

The direct answer might be: (define (sumiteration someList) (do ((sum 0) (L someList (cdr L))) ((null? L) sum) (set! sum (+ sum (car L))))) 1) There was a sum referenced in the (set! sum (+ sum x)) that was not previously defined. 2) Nothing advanced the list L. For a reasonably short input list, yo...