call-with-string-output-port - call a procedure with a string output port
(import (rnrs)) ;R6RS
(import (rnrs io ports)) ;R6RS
Creates a textual output port that accumulates the characters written
to it and calls
with that output port as an argument.
returns, a string consisting of all of the port's accumulated
characters (regardless of the port's current position) is returned and
the port is closed.
The port should support the
The port may or may not have an associated transcoder; if it does, the
transcoder is implementation-dependent.
Returns a single value; a string.
(for-each (lambda (x)
(display x p))
'("Hello " world #\newline))))
=> "Hello world\n"
This procedure is commonly used when creating strings piecemeal.
This procedure is unique to R6RS. It is a wrapper around
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 a procedure that accepts one argument.
This procedure is 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
Markup created by unroff 1.0sc, March 04, 2023.