put-string, write-string - write a string to a textual output port
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
(import (scheme base)) ;R7RS
; R6RS only:
(put-string textual-output-port string)
(put-string textual-output-port string start)
(put-string textual-output-port string start count)
; R7RS only:
(write-string string textual-output-port)
(write-string string textual-output-port start)
(write-string string textual-output-port start end)
starting at index
characters are written,
(string-length string) − start.
The characters from
argument defaults to 0.
Returns unspecified values.
Returns an unspecified value.
(write-string "Hello, world!\n")
This procedure is used, instead of a generic procedure like
because it is slightly faster and makes it possible to write only part
of the string.
The R7RS variant specifies
to be consistent with other procedures.
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.
must be non-negative exact integer objects,
must have a length of at least
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 was introduced in R6RS as part of the reworked I/O design.
procedure is new in R7RS.
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.