Next, we come to make-broadcast-stream. This isn’t really a difficult concept to understand, but I highlight it because it’s not a primitive that appears in the C library, so a new Lisp programmer coming from C++ might not realize that this tool is available. This function creates an output stream that transparently splits its data streams out into one or more target streams. The most obvious uses for this are for setting up a mode that echos data to the screen as well as its normal output target, or for creating a unified transcript of client and server messages for debugging purposes. Naturally, any other context where you want to send the same data to multiple output streams also benefits from this function.
Earlier in this series I skipped broadcast-stream-streams as I was waiting to include it with make-broadcast-stream. The broadcast-stream-streams function returns a list of the streams to which the broadcast stream sends its output.