bytevector-append(3scm) Scheme Programmer's Manual bytevector-append(3scm)

bytevector-append - append bytevectors

(import (scheme base))              ;R7RS

(bytevector-append bytevector ...)

Returns a newly allocated bytevector whose elements are the concatenation of the elements in the given bytevectors.

Returns a single bytevector object.

(bytevector-append #u8(0 1 2) #u8(3 4 5))
          => #u8(0 1 2 3 4 5)

This procedure is absent from R6RS. One possible implementation is shown below.
(define (bytevector-append . bvs)
  (call-with-bytevector-output-port
    (lambda (p)
      (for-each (lambda (bv) (put-bytevector p bv)) bvs))))

It is an error if one of the arguments is not a bytevector. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.

make-bytevector(3scm), append(3scm)

R7RS

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/.

2021-02-28