Racket: Would be beautiful to have `combine-output-ports` procedure.

Created on 4 Jul 2019  路  3Comments  路  Source: racket/racket

With specs:

(combine-output-ports聽what聽. with)聽鈫捖爋utput-port?
    what聽:聽output-port?
    with聽:聽list of output-port?

As example it very useful in this case:

(with-logging-to-port ((combine-output-ports
                        (current-error-port)
                        (open-output-file "my.log"))
    MY-SYNTAX
)

Procedure make-output-port is too unfriendly for this purposes.
I wonder why such procedure isn't already exists in racket/port package.

feature request

Most helpful comment

Unless @EligiusSantori wants to, I could implement this as my first contribution to racket :)
Seems straightforward.

All 3 comments

I agree that such a function would be useful to have in racket/port, but in the meantime, it might help you to look at make-pipe and copy-port, which together make an implementation of this function pretty easy since copy-port accepts multiple output ports.

Unless @EligiusSantori wants to, I could implement this as my first contribution to racket :)
Seems straightforward.

Closed by #2726

Was this page helpful?
0 / 5 - 0 ratings