Scheme Programmer's Manual
bytevector-length - the length of a bytevector
(import (rnrs)) ;R6RS
(import (rnrs bytevectors)) ;R6RS
(import (scheme base)) ;R7RS
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))
This procedure is often used in code that deals with variable-length
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.
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.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Return to Main Contents
- IMPLEMENTATION NOTES
- RETURN VALUES
- APPLICATION USAGE
- SEE ALSO