Scheme Programmer's Manual

NAME

bytevector-length - the length of a bytevector

LIBRARY

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

SYNOPSIS

(bytevector-length bytevector)

DESCRIPTION

Returns, as an exact integer object, the number of bytes in bytevector. The length of a bytevector is fixed.

IMPLEMENTATION NOTES

All extant implementations use fixnums to represent bytevector lengths, but this is not required.

RETURN VALUES

Returns a single value which is the length of the bytevector.

EXAMPLES

(bytevector-length #vu8(1 2 3))
          => 3

APPLICATION USAGE

This procedure is often used in code that deals with variable-length binary data.

COMPATIBILITY

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.

ERRORS

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.

SEE ALSO

make-bytevector(3)

STANDARDS

R6RS, R7RS

HISTORY

The name first appeared in R6RS. SRFI-4 is the first SRFI to define a procedure similar to this one.

AUTHORS

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
IMPLEMENTATION NOTES
RETURN VALUES
EXAMPLES
APPLICATION USAGE
COMPATIBILITY
ERRORS
SEE ALSO
STANDARDS
HISTORY
AUTHORS
Return to Main Contents