Skip to content

Instantly share code, notes, and snippets.

@bcc32
bcc32 / streams.scm
Created May 12, 2016 11:39
The classic Haskell example in Scheme
(define-syntax stream-cons
(syntax-rules ()
((_ h t)
(cons h (delay t)))))
(define stream-car car)
(define (stream-cdr stream)
(force (cdr stream)))
(define stream-nil '())