bytevector-length - the length of a bytevector
(import (rnrs)) ;R6RS
(import (rnrs bytevectors)) ;R6RS
(import (scheme base)) ;R7RS
(bytevector-length bytevector)
Returns, as an exact integer object, the number of bytes in bytevector.
The length of a bytevector is fixed.
All extant implementations use fixnums to represent bytevector lengths, but this
is not required.
Returns a single value which is the length of the bytevector.
(bytevector-length #vu8(1 2 3))
=> 3
This procedure is often used in code that deals with variable-length binary
data.
This procedure works the same in all known Scheme implementations. It also
appears in other languages as e.g. the len function on byte objects in
Python.
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.
The name first appeared in R6RS. SRFI-4 is the first SRFI to define a procedure
similar to this one.