string->list, list->string - convert between strings and lists
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
(string->list string start) ;R7RS
(string->list string start end) ;R7RS
procedure returns a newly allocated list of the characters that make
up the given string.
procedure returns a newly allocated string formed from the characters
These procedures are inverses so far as
is concerned, and preserve the order of the characters.
procedure returns a newly allocated list
of the characters of string between
Some implementations have a single empty string object; see
Both of these procedures return a single value. The
procedure returns a list (a pair or the empty list); the
procedure returns a string object.
(string->list "Quux") => (#\Q #\u #\u #\x)
(list->string '(#\f #\o #\o)) => "foo"
These procedures can be seen in some highly functional programming styles.
arguments are unique to R7RS. The only other difference between
implementations is whether the empty string is newly allocated or not
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 list of characters and
must be a string.
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.
These procedures first appeared in R2RS. They are missing from IEEE
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.