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.