On 29 Sep 2009, at 10:46 am, David Rush wrote:

> A brief forward on character sets is necessary. I don't think Thing1
> should say *anything* other than that chars exist and may not be
> isomorphic to the set of exact whole numbers less than 255. All the
> Unicode magic can easily be in Thing2.
>
> Given the above assumption, this is, IMNSHO, the minimal set of IO
> functions needed. And while I expect people to thoroughly hate it, I
> hope the semantics are relatively obvious:
>
> (make-port name . options) ;=> port (and yes the options parameter
> avoids handwaving about input/output/append/etc modes)

I take it that's meant to open a file? Since there may be many other
types of ports (custom ports, string ports, network ports, subprocess
pipe ports, ...), IMHO it should be (make-file-port ...)

As for the rest: Aye, nicely pragmatic.

The behaviour of read-char in terms of read-octet will need careful
specifying for funny encodings, mind; some encodings have control
characters that shift modes and the like, but aren't part of any
character, so the byte on which a character boundary sits is a bit
vague. I guess the best approach to that is to say that read-char
reads 0 or more non-character octets, if present, then reads enough
octets to decode one character, and anything it's buffered, it shares
the buffer with read-octet.

This will run into issues with any hypothetical character encoding
that uses sub-octet character boundaries, but that can be dealt with
too, I think: if you do a read-octet when the character reader is in
mid-octet, then the spare bits are discarded and you get the next octet.

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/archives/author/alaric/




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

Reply via email to