fix `sequence->stream'

Closes PR 11932
This commit is contained in:
Matthew Flatt 2011-05-19 15:52:48 -07:00
parent 6bc43306ca
commit 4b9d88cc1d
2 changed files with 7 additions and 1 deletions

View File

@ -1062,7 +1062,7 @@
(set! vals (call-with-values (lambda () (pos->val pos)) list))
(unless (if pre-cont? (apply pre-cont? vals) #t)
(set! vals #f)
(set! empty? #f)))
(set! empty? #t)))
(set! empty? #t))
(set! done? #t)))
(make-do-stream (lambda () (force!) empty?)

View File

@ -21,4 +21,10 @@
(stream-cons (let loop () (loop))
empty)))
(test #t stream-empty? (sequence->stream (in-producer void (void))))
(test #t stream-empty? (sequence->stream (in-port read-byte (open-input-string ""))))
(test "hello" stream-first (sequence->stream (in-producer (lambda () "hello") (void))))
(test 65 stream-first (sequence->stream (in-port read-byte (open-input-string "A"))))
(report-errs)