newline - write a newline to a port
(import (rnrs)) ;R6RS
(import (rnrs io simple)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
Writes an end of line to
which defaults to the value returned by
This is equivalent to using
The port transcoder's eol-style determines which characters will be
written to the port.
Ports with their buffer-mode set to line will be be flushed
as a side-effect of calling this procedure.
Exactly how a newline is produced, and which characters are used,
differs from one operating system to another.
Returns unspecified values.
Returns an unspecified value.
(display "Hello, world!")
In R6RS programs this procedure may be used instead of \n in a string
or instead of writing #\linefeed. In R7RS programs this procedure
writes the characters that would have been selected for a newline by using a
This procedure has had the same basic functionality since R2RS. In
R6RS implementations it is possible to control the eol-style.
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.
First appeared in R2RS. Scheme running on top of MacLisp has access to
the same functionality through the
(TERminate PRInt line) function, which was also in LISP 1.5.
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.