current-input-port, current-output-port, current-error-port - get the current (default) ports
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (rnrs io simple)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
These return default textual ports for regular input, output and error
output. Normally, these default ports are associated with standard
input, standard output, and standard error, respectively.
The return value of
can be dynamically re-assigned using
A port returned by one of these procedures may or may not have an
associated transcoder; if it does, the transcoder is
These procedures are parameter objects, which can be overridden with
Standard input, output and error ports are concepts in general purpose
operating systems. The implementation should hook these ports up to
whatever standard I/O mechanism is provided by the operating system,
The error port should usually be unbuffered so that no output is lost
if the program exits unexpectedly.
These procedures return a single value; a port.
(display "There was an error.0 (current-error-port))
R7RS defines these procedures as parameters. They are likely to
internally be some form of parameters in all implementations, however,
because of how
etc, works. But one cannot expect to portably use them as parameters
outside of R7RS.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
The assertions described above are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
procedure first appeared in R6RS.
The other procedures are standard since R2RS.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.