vector-copy - copy a vector
(import (scheme base)) ;R7RS
(vector-copy vector start)
(vector-copy vector start end)
Returns a newly allocated copy of the elements of the given
The elements of the new vector are the same, in the sense of
as the elements of the old vector.
Returns a single value; a new vector object.
(define a #(1 8 2 8)) ; a may be immutable
(define b (vector-copy a)) ; b is mutable
(vector-set! b 0 3)
b => #(3 8 2 8)
(vector-copy b 1 3) => #(8 2)
There is an equivalent procedure is SRFI-43.
It is an error if the wrong number of arguments was passed
or an argument was outside its domain.
R7RS implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
The first RnRS revision with this procedure is R7RS, which took it
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.