(load "streams.txt") (define (stream-map proc . argstreams) (if (stream-null? (car argstreams)) the-empty-stream (cons-stream (apply proc (map stream-car argstreams)) (apply stream-map (cons proc (map stream-cdr argstreams)))))) ; 1 ]=> (load "streams.txt") ; ; ;Loading "streams.txt"... done ; ;Value: stream-enumerate-interval ; ; 1 ]=> (define ones-digits (stream-enumerate-interval 0 9)) ; ; ;Value: ones-digits ; ; 1 ]=> (define tens-digits (stream-map (lambda(x) (* x 10)) ones-digits)) ; ; ;Value: tens-digits ; ; 1 ]=> (define hundreds-digits (stream-map (lambda(x) (* x 10)) tens-digits)) ; ; ;Value: hundreds-digits ; ; 1 ]=> (display-stream (stream-map + ones-digits tens-digits hundreds-digits)) ; ; 0 ; 111 ; 222 ; 333 ; 444 ; 555 ; 666 ; 777 ; 888 ; 999