This is a supplementary proposal for 13 new identifiers to be added to
the "small Scheme" language beyond those of R5RS.  I am publishing this
document to invite wide comment.  There is nothing official about it.
As before I retain sole responsibility for it, including all errors.
I give the sources of the identifiers and features in square brackets.

I have cherry-picked features from R6RS port I/O that I think
would be useful in small Scheme, and updated the living version at
http://tinyurl.com/thing-one.  I looked at file-options, buffer-modes,
codecs, newline-styles, port?, textual-port?, and binary-port?, but
rejected them as unnecessary.

System defaults are generally satisfactory for file-options, buffer-modes,
and newline-styles on output, at least for Thing One purposes.  Input,
however, should handle all styles of newlines within whatever character
repertoire the implementation can handle, which is why read-line is
provided below.

A port is binary iff *-u8 operations are first done on it, textual if
R5RS operations are first done on it; mixing them has undefined behavior.
There are no operations that are provided for both input ports and output
ports, so there is no reason to provide port?.

New procedures (13 identifiers):

        [R6RS files] delete-file, file-exists?
        [R6RS io ports]
                port-position, set-port-position!
        [R6RS io ports with R5RS-style names]
                read-u8, write-u8, peek-u8, read-line
        [SRFI 6 for blobs]
                open-input-blob, open-output-blob, get-output-blob

I'm a little reluctant to say that codecs are entirely unnecessary, since
system defaults may well not suffice, although only the ASCII (trivial)
codec should be required.  There are just too many files lying about
systems these days with non-standard encodings.  If codecs are restored,
I propose this interface:

        [something like R6RS io ports] port-codec, set-port-codec!

If no codec is set and textual I/O is done, the system default applies.

--
John Cowan  [email protected]   http://ccil.org/~cowan
Assent may be registered by a signature, a handshake, or a click of a computer
mouse transmitted across the invisible ether of the Internet. Formality
is not a requisite; any sign, symbol or action, or even willful inaction,
as long as it is unequivocally referable to the promise, may create a contract.
       --Specht v. Netscape

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to