newline - write a newline to a port

LIBRARY

(import (rnrs))                     ;R6RS
(import (rnrs io simple))           ;R6RS
(import (scheme r5rs))              ;R7RS
(import (scheme base))              ;R7RS

SYNOPSIS

(newline)
(newline textual-output-port)

DESCRIPTION

Writes an end of line to textual-output-port, which defaults to the value returned by current-output-port(3scm).
R6RS
This is equivalent to using write-char(3scm) to write #\linefeed to textual-output-port.

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.

R7RS
Exactly how a newline is produced, and which characters are used, differs from one operating system to another.

RETURN VALUES

R6RS
Returns unspecified values.
R7RS
Returns an unspecified value.

EXAMPLES

(display "Hello, world!")
(newline)

APPLICATION USAGE

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 transcoder with native-eol-style(3scm) in R6RS.

COMPATIBILITY

This procedure has had the same basic functionality since R2RS. In R6RS implementations it is possible to control the eol-style.

ERRORS

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.
R7RS
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.

SEE ALSO

get-line(3scm), put-char(3scm)

STANDARDS

R4RS, IEEE Scheme, R5RS, R6RS, R7RS

HISTORY

First appeared in R2RS. Scheme running on top of MacLisp has access to the same functionality through the terpri (TERminate PRInt line) function, which was also in LISP 1.5.

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.


Markup created by unroff 1.0sc,    March 04, 2023.