vector-copy(3scm)
π
vector-copy (3scm) β the Scheme Programmer's Manual cutie π
okay bestie, welcome to the vector-copy(3scm) page from the Scheme Programmer's Manual β itβs giving βcopy that vectorβ and honestly? iconic. Letβs get into it. π¦β¨
β¨ NAME β¨
vector-copy β copy a vector π
π LIBRARY π
(import (scheme base)) ;R7RS
yep, thatβs the R7RS import, bestie. π
πΈ SYNOPSIS πΈ
(vector-copy vector)
(vector-copy vector start)
(vector-copy vector start end)
π«Ά DESCRIPTION π«Ά
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?(3scm) β as the elements of the old vector. no cap, thatβs the whole vibe. π
π RETURN VALUES π
Returns a single value: a new vector object. periodt. π
π EXAMPLES π
(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)
look at b thriving and mutable β we love to see it. ππ
π§ COMPATIBILITY π§
Thereβs an equivalent procedure in SRFI-43. yep, the SRFI-43 girlies are covered too. π
π ERRORS π
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.
that last one is not a vibe, bestie β proceed with caution. ππ
π SEE ALSO π
vector-copy! (3scm) β go check that one too, iykyk. β¨
β STANDARDS β
R7RS, SRFI-43
π HISTORY π
The first RnRS revision with this procedure is R7RS, which took it from SRFI-43. history lesson slay. π
π
π AUTHORS π
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at:
https://github.com/schemedoc/manpages/
xoxo, this vector-copy(3scm) page is from the Scheme Programmer's Manual and is dated 2022-04-10 β mwah ππ
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2022 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms