Lecture overview -- Keyboard shortcut: 'u'  Previous page: Tail Calls -- Keyboard shortcut: 'p'  Next page: Examples of recursion: string-merge -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Recursion and Higher-order Functions - slide 5 : 35

Example of recursion: number-interval
The function number-interval returns a list of integers from a lower bound to an upper bound
(define (number-interval f t)
 (if (<= f t)
     (cons f (number-interval (+ f 1) t))
The function number-interval-iter is an iterative, tail recursive variant of number-interval.
A sample dialogue with the number interval functions.
Go to exercise
The append function
Go to exercise
A list replication function