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

bytevector-copy - copy a bytevector

(import (rnrs))                     ;R6RS
(import (rnrs bytevectors))         ;R6RS
(import (scheme base))              ;R7RS

(bytevector-copy bytevector)
(bytevector-copy bytevector start)      ;R7RS
(bytevector-copy bytevector start end)  ;R7RS

Returns a newly allocated bytevector containing the bytes in bytevector between start (inclusive) and end (exclusive).

The default value for start is 0 and the default value for end is equal to the length of the input.

Returns a bytevector with the length end - start.

(define a #u8(1 2 3 4 5))
(bytevector-copy a 2 4))
   => #u8(3 4)

The R6RS version of this procedure only has the first argument.

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
R7RS
The assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.

bytevector-copy!(3scm)

R6RS, 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-20