[r6rs-discuss] Issues with section 8.2. Port I/O, a.k.a. (rnrs io ports (6))

From: John Cowan <cowan>
Date: Mon, 27 Aug 2007 19:48:06 -0400

William D Clinger scripsit:

> > The three listed buffer modes are none, line, and block.
>
> FYI, Larceny's preferred buffer mode for interactive output
> ports is datum. The buffer-mode syntax does not allow datum,
> which is one of several reasons that syntax is deprecated
> in Larceny.

Formal comment #185, which was adopted by the editors, says that line
buffering is explicitly implementation-dependent; the draft should be
changed to make it so. I think it would be within editorial discretion to
extend the license in 8.2.4 to provide implementation-dependent results
on nonstandard eol-symbols to buffer-mode-symbols as well.

> > A related question: what's the rationale for including the
> > "buffer-mode?" predicate?
>
> There is none, just as there is no rationale for the
> buffer-mode syntax.

The rationale for the predicate is to determine which symbols are valid
buffer modes in the current implementation (assuming the above license
is provided.) The rationale for the syntax is to allow compile-time
checks for invalid buffer-modes.

> People who write code often prefer to drop the optional
> argument. Programs that write code often prefer to use
> #f instead of dropping it.

Procedures that accept a transcoder may also wish to use the #f style to
avoid a conditional branch; you can simply pass along what your caller
provides, and if it happens to be #f, fine.

> > This section mentions the get-line procedure. Is there a
> > similar put-line procedure that I'm missing somewhere?
>
> The index lists no such procedure. It's hard for me to
> imagine what its intended semantics might be.

Presumably to output a value (a string, or an object, as the case may be)
followed by the specified or defaulted output-port's notion of a linefeed,
whatever that may be. It's easy to write your own.

> When you actually implement this stuff, you will discover
> quite a few dark corners that make the above issues look
> simple.

Please tell us about them.

-- 
John Cowan      cowan at ccil.org
        "Not to know The Smiths is not to know K.X.U."  --K.X.U.
Received on Mon Aug 27 2007 - 19:48:06 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC