manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.6.7 Accessing Bytevectors with the Generalized Vector API

As an extension to the R6RS, Guile allows bytevectors to be manipulated with the generalized vector procedures (see section Generalized Vectors). This also allows bytevectors to be accessed using the generic array procedures (see section Array Procedures). When using these APIs, bytes are accessed one at a time as 8-bit unsigned integers:

(define bv #vu8(0 1 2 3))

(generalized-vector? bv)
⇒ #t

(generalized-vector-ref bv 2)
⇒ 2

(generalized-vector-set! bv 2 77)
(array-ref bv 2)
⇒ 77

(array-type bv)
⇒ vu8

This document was generated on February 3, 2012 using texi2html 5.0.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.