From 5dcebb86ac3d0f5c423ea67acae79c607a86f6fe Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 20 Sep 2012 17:23:14 -0600 Subject: [PATCH] change `stream-append' to use its last argument as the result tail Closes PR 13130 --- collects/racket/stream.rkt | 1 + collects/scribblings/reference/sequences.scrbl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/collects/racket/stream.rkt b/collects/racket/stream.rkt index bbbf892d35..f5cceb4f10 100644 --- a/collects/racket/stream.rkt +++ b/collects/racket/stream.rkt @@ -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) diff --git a/collects/scribblings/reference/sequences.scrbl b/collects/scribblings/reference/sequences.scrbl index dec5a3be0c..758517f2a5 100644 --- a/collects/scribblings/reference/sequences.scrbl +++ b/collects/scribblings/reference/sequences.scrbl @@ -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?])