Created
February 24, 2013 17:55
-
-
Save dschobel/5024821 to your computer and use it in GitHub Desktop.
streams in scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (stream-maker seed fx) | |
(letrec ([f (lambda(x) (cons x (lambda () (fx x))))]) | |
(lambda () (f seed)))) | |
(define naturals (stream-maker 1 (lambda (x) (+ x 1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment