input-port-append: add #:name argument

This commit is contained in:
Matthew Flatt 2018-03-06 20:01:47 -07:00
parent 9d77ffe6d5
commit d8dce77984
4 changed files with 19 additions and 7 deletions

View File

@ -12,7 +12,7 @@
(define collection 'multi)
(define version "6.90.0.18")
(define version "6.90.0.19")
(define deps `("racket-lib"
["racket" #:version ,version]))

View File

@ -157,7 +157,10 @@ Equivalent to
@section{Creating Ports}
@defproc[(input-port-append [close-at-eof? any/c] [in input-port?] ...) input-port?]{
@defproc[(input-port-append [close-at-eof? any/c]
[in input-port?] ...
[#:name name any/c (map object-name in)])
input-port?]{
Takes any number of input ports and returns an input port. Reading
from the input port draws bytes (and special non-byte values) from the
@ -167,8 +170,13 @@ or when the result input port is closed. Otherwise, data not read from
the returned input port remains available for reading in its original
input port.
The @racket[name] argument determines the name as reported by
@racket[object-name] for the returned input port.
See also @racket[merge-input], which interleaves data from multiple
input ports as it becomes available.}
input ports as it becomes available.
@history[#:changed "6.90.0.19" @elem{Added the @racket[name] argument.}]}
@defproc[(make-input-port/read-to-peek

View File

@ -928,10 +928,14 @@
(evt 'write-spec-evt (list v)))))
(values in out))))
(define unspecified (gensym))
(define input-port-append
(lambda (close-orig? . ports)
(lambda (close-orig? #:name [name unspecified] . ports)
(make-input-port
(map object-name ports)
(if (eq? name unspecified)
(map object-name ports)
name)
(lambda (str)
;; Reading is easy -- read from the first port,
;; and get rid of it if the result is eof

View File

@ -13,12 +13,12 @@
consistently.)
*/
#define MZSCHEME_VERSION "6.90.0.18"
#define MZSCHEME_VERSION "6.90.0.19"
#define MZSCHEME_VERSION_X 6
#define MZSCHEME_VERSION_Y 90
#define MZSCHEME_VERSION_Z 0
#define MZSCHEME_VERSION_W 18
#define MZSCHEME_VERSION_W 19
#define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y)
#define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W)