bytevector -- r7rs Type bytevector?;bytevector-append;bytevector-copy;bytevector-copy!;utf8->string;open-input-bytevector;write-bytevector;Note: These definitions produce an output that is a sub-type.
bytevector?
Bytevectors represent blocks of binary data. They are fixed-length sequences of bytes, where a byte is an exact integer in the range from
0to255inclusive. A bytevector is typically more space-efficient than a vector containing the same values.The length of a bytevector is the number of elements that it contains. This number is a non-negative integer that is fixed when the bytevector is created. The valid indexes of a bytevector are the exact non-negative integers less than the length of the bytevector, starting at index zero as with vectors.
Bytevectors are written using the notation
#u8(byte ...). For example, a bytevector of length3containing the byte0in element0, the byte10in element1, and the byte5in element2can be written as follows:#u8(0 10 5)Bytevector constants are self-evaluating, so they do not need to be quoted in programs.
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.