binary vs non-binary ports Per Bothner (16 Sep 2004 04:51 UTC)
Re: binary vs non-binary ports Alex Shinn (16 Sep 2004 05:34 UTC)
Re: binary vs non-binary ports Per Bothner (16 Sep 2004 06:54 UTC)
Re: binary vs non-binary ports Alex Shinn (16 Sep 2004 07:26 UTC)
Re: binary vs non-binary ports Shiro Kawai (16 Sep 2004 08:30 UTC)
Re: binary vs non-binary ports Alex Shinn (17 Sep 2004 03:43 UTC)
Re: binary vs non-binary ports Alex Shinn (17 Sep 2004 05:32 UTC)
Re: binary vs non-binary ports Per Bothner (17 Sep 2004 17:22 UTC)
Re: binary vs non-binary ports Shiro Kawai (17 Sep 2004 20:44 UTC)
Re: binary vs non-binary ports Hans Oesterholt-Dijkema (17 Sep 2004 21:26 UTC)
Re: binary vs non-binary ports Alex Shinn (18 Sep 2004 02:15 UTC)
Re: binary vs non-binary ports Per Bothner (18 Sep 2004 16:31 UTC)
Re: binary vs non-binary ports Bradd W. Szonye (18 Sep 2004 17:43 UTC)
Re: binary vs non-binary ports Per Bothner (18 Sep 2004 19:51 UTC)
Re: binary vs non-binary ports Hans Oesterholt-Dijkema (18 Sep 2004 18:04 UTC)
Re: binary vs non-binary ports Bradd W. Szonye (18 Sep 2004 19:21 UTC)
Re: binary vs non-binary ports Alex Shinn (20 Sep 2004 02:06 UTC)
Re: binary vs non-binary ports Per Bothner (20 Sep 2004 02:46 UTC)
Re: binary vs non-binary ports Alex Shinn (18 Sep 2004 02:21 UTC)
Re: binary vs non-binary ports Per Bothner (18 Sep 2004 20:04 UTC)
Re: binary vs non-binary ports Hans Oesterholt-Dijkema (17 Sep 2004 21:37 UTC)
Re: binary vs non-binary ports Hans Oesterholt-Dijkema (17 Sep 2004 22:40 UTC)
Re: binary vs non-binary ports Hans Oesterholt-Dijkema (17 Sep 2004 22:48 UTC)

Re: binary vs non-binary ports Shiro Kawai 16 Sep 2004 08:30 UTC

>From: Per Bothner <xxxxxx@bothner.com>
Subject: binary vs non-binary ports
Date: Wed, 15 Sep 2004 21:51:44 -0700

>  From the draft:
>  > Some Schemes may wish to distinguish between binary and non-binary
>  > ports as in Common-Lisp. As these can be layered on top of the
>  > current ports this may better be relegated to a separate SRFI.
>
> Huh?  This is backwards.  The current ports are character ports.
> As such they are layered on top of byte ports.  I.e. non-binary
> ports are layered on top of binary ports.

Certainly there are implementations that inherently needs to
distinguish character and binary ports, so I see Per's point.
I can think of two resolutions.

(1) changing the phrase in the draft to mention that:
- Some implementations inherently need to distinguish character
  and binary ports.
- If the port doesn't support the requested operation, an exception
  is raised (already mentioned in the draft).
- The API to distinguish character/binary ports is beyond this srfi

(2) including primitive predicates, something like port-binary-io-capable?,
    into this srfi, so that a portable program can be written.

> It makes no sense to mix character and binary I/O on the same port.
> Anyone who tries it is in a state of sin.

I know one instance that I need to mix both.

There are Scheme source code around that their comments are
written in non us-ascii charsets, although their code part
is in us-ascii.   While dealing with such sources, it is very
annoying that the input port throws an "invalid multibyte
sequence" exception when the reader is consuming the comment
string.  Using binary I/O in skipping comment avoids this
situation.   It is not nice, but such robustness is mandatory
if you're in a community that exchanges source code with
comments in various encodings...

--shiro