string-fill! - fill a string with a character
(import (rnrs mutable-strings)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
(string-fill! string char)
(string-fill! string char start) ;R7RS
(string-fill! string char start end) ;R7RS
in every element of
defaults to 0 and
defaults to the length of
Returns unspecified values.
Returns an unspecified value.
;; R7RS example
(let ((s (make-string 4 #\x)))
(string-fill! s #\y 2)
s) => "xxyy"
This procedure is used to fill strings that have already been created.
It has marginal utility. The second argument to
fills the entire string at creation time.
arguments are unique to 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.
The first Scheme report to carry this procedure was R2RS, which also
that filled a substring, but used a different argment order:
(substring-fill! string start end char).
It is missing from IEEE Scheme.
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.