standard-input-port, standard-output-port, standard-error-port - fresh standard I/O ports
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
Returns a fresh binary port connected to standard input, standard
output or standard error respectively. The first returns an input port
and the latter two return output ports.
Whether the port supports the
operations is implementation-dependent.
Returns a single value; a fresh port.
The following program converts its standard input from ISO-8859-1 to
UTF-8 on its standard output.
(let lp ()
(let ((c (get-char inp)))
(unless (eof-object? c)
(put-char outp c)
This is used in application that need binary I/O on the standard
input, output and error. It can also be used to create transcoded
ports for when the default transcoder on
etc is not desired.
These procedures make it possible to do binary I/O on standard input,
output and error.
These procedures are unique to R6RS. There is nothing similar in R7RS
but some implementations will, as an extension, allow binary I/O on
textual ports. Chibi-Scheme is an example of such an implementation.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed.
These procedures are new to the reworked I/O in R6RS.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Programs should use
on these ports before exiting, or use
The ports can be buffered and not all
implementations flush open ports at exit.
Markup created by unroff 1.0sc, March 04, 2023.