Play audio slide show -- Keyboard shortcut: 'x'  Lecture overview -- Keyboard shortcut: 'u'  Previous page: Example streams -- Keyboard shortcut: 'p'  Next page: Applications of The sieve of Eratosthenes -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home      The Order of Evaluation - slide 25 : 26

Stream example: The sieve of Eratosthenes
The Sieve of Eratosthenes is a more sophisticated example of the use of streams
(define (sieve stream)
   (cons-stream
     (head stream)
     (sieve 
       (filter-stream
         (lambda (x) (not (divisible? x (head stream))))
         (tail stream)))))