vector-append(3scm)

πŸ“¦ version 0-unstable-2024-02, in nixpkgs unstable

πŸ’… vector-append β€” append vectors

okay so real talk, you're looking at the vector-append page from the Scheme Programmer's Manual, and honestly? it's a little bop. let's get into it bestie 🫢


✨ LIBRARY ✨

(import (scheme base))              ;R7RS

that's the import you need, no cap. it's R7RS flavored πŸ“


🌸 SYNOPSIS 🌸

(vector-append vector ...)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you hand it a bunch of vectors, and it hands you back a brand new freshly allocated vector whose elements are just... all of the elements of the given vectors, smooshed together in a row. the concatenation. the whole lineup. it's giving friendship bracelet energy where everyone's beads end up on one string πŸ’–


🌈 RETURN VALUES 🌈

it returns a single value, and that single value is a vector object. one (1) vector. that's it. slay ✨


πŸŽ€ EXAMPLES πŸŽ€

(vector-append #(a b c) #(d e f))
        => #(a b c d e f)

look at that. ate and left no crumbs πŸ‘‘


πŸ’œ COMPATIBILITY πŸ’œ

the vector-append over in SRFI-43 is identical to the one in R7RS. same function, different era. no drama, no differences, fr fr 🀝


πŸ’€ ERRORS πŸ’€

[R7RS] it is an error if one of the arguments is not a vector. like, genuinely an error. not a vibe.

and here's where it gets spicy β€” implementations are allowed to do any of these:

  • signal an error 😭
  • extend the procedure's domain of definition to include such arguments πŸ‘€
  • or fail catastrophically πŸ’€

yeah. catastrophically. that's the actual word in the spec. so maybe don't pass it a non-vector unless you're feeling brave πŸ™ˆ


🧚 SEE ALSO 🧚

  • append(3scm) β€” the cousin. the relative. go say hi 🫢

⭐ STANDARDS ⭐

R7RS, SRFI-43


πŸ•°οΈ HISTORY πŸ•°οΈ

so the first RnRS report to actually carry this procedure is R7RS, and R7RS got it from SRFI-43. passing it down like a family recipe πŸ“


πŸ‘‘ AUTHORS πŸ‘‘

this page is part of the scheme-manpages</scheme-manpages> project, and it includes materials from the RnRS documents. more info lives at https://github.com/schemedoc/manpages/ 🌸


and that's the whole page bestie, hope your vectors concatenate beautifully πŸ’–βœ¨

scheme-manpages project Β· dated 2022-03-29 Β· vector-append(3scm) Β· mwah πŸ’…

πŸ“¦ where this page comes from