Welcome to the CHICKEN Scheme pasting service

linear recursion added by int0X80 on Sat Jan 26 18:57:28 2013

(define (sum term a next b)
        (define (iter a  result)
                (if (> a b)
                        result
                        (iter (next a) (+ result (term a)))))
        (iter a 0))


(define (cube x) (* x x x))


(define (next x) (+ x 1))

(define (sum-cube a b)
        (sum cube a next b))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which one-argument R5RS procedure returns 1 when given `'(1 2 3)' as input?
Visually impaired? Let me spell it for you (wav file) download WAV