[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: current input & output ports



Taylor Campbell <campbell@xxxxxxxxxxxxxxxxxx> 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