[r6rs-discuss] Question on buffer modes
On May 23, 2007, at 10:20 PM, R. Kent Dybvig wrote:
>> In section "8.3.2. Buffer modes", the second and
>> third paragraphs talk about ports that are connected
>> to the same mutable source, yet I'm not seeing how
>> one would actually get two ports to connect to the
>> same source to begin with. Am I overlooking where
>> that mechanism is described in the report?
>
> In most implementations, the ports returned by multiple calls to
> standard-input-port will be connected to the same source.
> Similarly, the
> ports returned by multiple calls to standard-output-port or
> standard-error-port may be connected to the same sink; in fact, a port
> returned by standard-output-port may be connected to the same sink
> as a
> port returned by standard-error-port.
I just realized that these procedures return a fresh port each
time they're called. I need to think more about how this would
affect my implementation.
> The current-output and
> current-error ports may be connected to the same sink at the time the
> program starts. One can also get two ports to connect to the same
> source
> or sink via custom ports. For example, you might create two custom
> ports
> that forward data from the same file, string, or bytevector port.
Thanks for the explanation.
Aziz,,,
Received on Wed May 23 2007 - 22:31:45 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC