Need help with a function in DrScheme
Posted: Sun Mar 07, 2010 10:09 pm
I can write the recursion version correctly need help with writing a do loop in DrScheme.
After the do loop the variable x is sent to car L intially and then is updated to first element of everything but first element in list.
After the do loop the variable x is sent to car L intially and then is updated to first element of everything but first element in list.
Code: Select all
(Toggle Plain Text)
(define (sumiteration L)
(do ((x (car L) (car(cdr L))))
((null? L))
(set! sum (+ sum x)))
)