current input & output ports Taylor Campbell (17 Jun 2005 01:32 UTC)
Re: current input & output ports Alex Shinn (17 Jun 2005 01:51 UTC)
Re: current input & output ports Taylor Campbell (17 Jun 2005 04:46 UTC)
Re: current input & output ports Per Bothner (17 Jun 2005 06:46 UTC)
Re: current input & output ports Michael Sperber (17 Jun 2005 21:23 UTC)
Re: current input & output ports Taylor Campbell (17 Jun 2005 23:53 UTC)
Re: current input & output ports bear (19 Jun 2005 18:51 UTC)

Re: current input & output ports Michael Sperber 17 Jun 2005 21:22 UTC

Taylor Campbell <xxxxxx@bloodandcoffee.net> writes:

> One thing that has always bothered me about Scheme's I/O system is the
> seemingly random presence of 'current ports.'  I haven't been able to
> find a rationale for the existence of the mechanism, and exactly what
> the 'current {input,output} port' is meant to be used for has never
> been clear to me.  Not only is the mechanism itself vague, but it also
> introduces unnecessary complexities in the interface: because the port
> argument to many operations is optional (which I believe Mike doesn't
> like anyway), the port must go last, which skews the possibility of
> other optional arguments and which is contrary to the very common
> convention of putting the important aggregate datum in the first
> argument.  Finally, the stream interface has no such similar 'current
> input stream' or 'current output stream,' so the stream operations are
> inconsistent with their port counterparts with optional arguments.

The more I think about it, the more I like it.  There are two
downsides:

- The last vestige of R5RS compatibility goes out the window.  Does
  anyone care?

- This SRFI is then no longer suitable for ad-hoc debugging output
  (which, I think, provides the rationale for CURRENT-OUTPUT-PORT).
  This means somebody needs to write the Definitive printf SRFI.

Again, I'd like to get a sense of how much people care about R5RS
compatibility for the "default I/O system."

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla