Exercises in this lecture   Go to the notes, in which this exercise belongs -- Keyboard shortcut: 'u'   Alphabetic index   Course home   

Exercise solution:
A variant of number-interval


(define (number-interval f t)
 (cond ((< f t)
         (cons f (number-interval (+ f 1) t)))
       ((> f t )
         (cons f (number-interval (- f 1) t)))
       (else ; (= f t)
         (list f))))