[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.6.6 Bytevectors
A bytevector is a raw bit string. The (rnrs bytevectors)
module provides the programming interface specified by the
Revised^6 Report on the Algorithmic Language Scheme (R6RS). It contains procedures to manipulate bytevectors and
interpret their contents in a number of ways: bytevector contents can be
accessed as signed or unsigned integer of various sizes and endianness,
as IEEE-754 floating point numbers, or as strings. It is a useful tool
to encode and decode binary data.
The R6RS (Section 4.3.4) specifies an external representation for
bytevectors, whereby the octets (integers in the range 0–255) contained
in the bytevector are represented as a list prefixed by #vu8
:
#vu8(1 53 204)
denotes a 3-byte bytevector containing the octets 1, 53, and 204. Like string literals, booleans, etc., bytevectors are “self-quoting”, i.e., they do not need to be quoted:
#vu8(1 53 204) ⇒ #vu8(1 53 204)
Bytevectors can be used with the binary input/output primitives of the R6RS (see section R6RS I/O Ports).
6.6.6.1 Endianness | Dealing with byte order. | |
6.6.6.2 Manipulating Bytevectors | Creating, copying, manipulating bytevectors. | |
6.6.6.3 Interpreting Bytevector Contents as Integers | Interpreting bytes as integers. | |
6.6.6.4 Converting Bytevectors to/from Integer Lists | Converting to/from an integer list. | |
6.6.6.5 Interpreting Bytevector Contents as Floating Point Numbers | Interpreting bytes as real numbers. | |
6.6.6.6 Interpreting Bytevector Contents as Unicode Strings | Interpreting bytes as Unicode strings. | |
6.6.6.7 Accessing Bytevectors with the Array API | Guile extension to the bytevector API. | |
6.6.6.8 Accessing Bytevectors with the SRFI-4 API | Bytevectors and SRFI-4. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.