| vector->string(3scm) | Scheme Programmer's Manual | vector->string(3scm) |
NAME
vector->string - convert a vector of characters to a stringLIBRARY
(import (scheme base)) ;R7RS
SYNOPSIS
(vector->string vector) (vector->string vector start) (vector->string vector start end)
DESCRIPTION
Returns a newly allocated string of the objects contained in the elements of vector between start (inclusive) and end (exclusive). The order of the characters is preserved.The argument start defaults to 0 and end defaults to the length of vector.
IMPLEMENTATION NOTES
- Loko Scheme
- There is a single unique empty string object, so the returned string will not always be newly allocated.
RETURN VALUES
Returns a single value; a string.EXAMPLES
(vector->string #(#\1 #\2 #\3)) => "123"
RATIONALE
R7RS says that this procedure and a few others were added in order to round out the sequence operations.COMPATIBILITY
This procedure is unique to R7RS. Compatible procedures can be found in SRFI-133 and SRFI-152.ERRORS
It is an error to pass the wrong number of arguments, and to pass an argument that is outside its domain. In particular, vector must be a vector of characters, start must be non-negative and not greater than end, and end must not be greater than the length of vector. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.It is also an error for vector to contain a character which the implementation does not support. 7-bit ASCII (except #\null) must be supported. Any other character is optional and potentially an error (as described above). You can use the full-unicode feature identifier in cond-expand(3scm) to check if all of Unicode 6.0 is supported.
SEE ALSO
string->vector(3scm)STANDARDS
R7RSHISTORY
This procedure first appeared in R7RS.AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.| 2023-01-27 |