change `stream-append' to use its last argument as the result tail

Closes PR 13130
This commit is contained in:
Matthew Flatt 2012-09-20 17:23:14 -06:00
parent 3f4b117c1a
commit 5dcebb86ac
2 changed files with 3 additions and 1 deletions

View File

@ -105,6 +105,7 @@
(define (streams-append l)
(cond
[(null? l) empty-stream]
[(null? (cdr l)) (car l)]
[(-stream-empty? (car l)) (streams-append (cdr l))]
[else
(make-do-stream (lambda () #f)

View File

@ -717,7 +717,8 @@ A shorthand for nested @racket[stream-cons]es ending with
stream?]{
Returns a stream that contains all elements of each stream in the
order they appear in the original streams. The new stream is
constructed lazily.}
constructed lazily, while the last given stream is used in the tail of
the result.}
@defproc[(stream-map [f procedure?]
[s stream?])