chickadee » scheme » base » vector-copy

vector-copy vector #!optional start endprocedure

Returns a newly allocated copy of the elements of the given vector between start and end. The elements of the new vector are the same (in the sense of eqv?) as the elements of the old.

(define a #(1 8 2 8)) ; a may be immutable
(define b (vector-copy a))
(vector-set! b 0 3)   ; b is mutable
b  ==> #(3 8 2 8)
(define c (vector-copy b 1 3))
c  ==> #(8 2)