chickadee » sicp » stream-enumerate-interval

stream-enumerate-interval low highprocedure

Enumerates the interval between low and high streamingly.

low
The lower bound
high
The upper bound
(define (stream-enumerate-interval low high)
  (if (> low high)
    stream-null
    (cons-stream low (stream-enumerate-interval (+ low 1) high))))