bytevector-copy! -- r7rs Definition procedure!;
bytevector-copy! (from vonuvoli);Procedure variants:
(((source bytevector) (source-start range-start) (destination bytevector)) -> (undefined))
source of type bytevector;source-start of type range-start;destination of type bytevector;undefined;(((source bytevector) (source-start range-start) (destination bytevector) (destination-start range-start)) -> (undefined))
source of type bytevector;source-start of type range-start;destination of type bytevector;destination-start of type range-start;undefined;(((source bytevector) (source-start range-start) (destination bytevector) (destination-start range-start) (destination-end range-end)) -> (undefined))
source of type bytevector;source-start of type range-start;destination of type bytevector;destination-start of type range-start;destination-end of type range-end;undefined;scheme:base -- (scheme base);scheme -- (scheme);(bytevector-copy! to at from) (bytevector-copy! to at from start) (bytevector-copy! to at from start end)Domain: It is an error if
atis less than zero or greater than the length ofto. It is also an error if(- (bytevector-length to) at)is less than(- end start).Copies the bytes of bytevector
frombetweenstartandendto bytevectorto, starting atat. The order in which bytes are copied is unspecified, except that if the source and destination overlap, copying takes place as if the source is first copied into a temporary bytevector and then into the destination. This can be achieved without allocating storage by making sure to copy in the correct direction in such circumstances.(define a (bytevector 1 2 3 4 5)) (define b (bytevector 10 20 30 40 50)) (bytevector-copy! b 1 a 0 2) b ===> #u8(10 1 2 40 50)Note: This procedure appears in R6RS, but places the source before the destination, contrary to other such procedures in Scheme.
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.