Guile Reference Manual
22.6.4 Bit Vectors
Bit vectors are a specific type of uniform array: an array of booleans
with a single zerobased index.
They are displayed as a sequence of 0
s and
1
s prefixed by #*
, e.g.,
 (makeuniformvector 8 #t #f) =>
#*00000000
#b(#t #f #t) =>
#*101

 Scheme Procedure: bitcount b bitvector

 C Function: scm_bit_count (b, bitvector)
 Return the number of occurrences of the boolean b in
bitvector.
 Scheme Procedure: bitposition item v k

 C Function: scm_bit_position (item, v, k)
 Return the minimum index of an occurrence of bool in
bv which is at least k. If no bool occurs
within the specified range
#f
is returned.
 Scheme Procedure: bitinvert! v

 C Function: scm_bit_invert_x (v)
 Modify bv by replacing each element with its negation.
 Scheme Procedure: bitset*! v kv obj

 C Function: scm_bit_set_star_x (v, kv, obj)
 If uve is a bitvector bv and uve must be of the same
length. If bool is
#t
, uve is OR'ed into
bv; If bool is #f
, the inversion of uve is
AND'ed into bv.
If uve is a unsigned long integer vector all the elements of uve
must be between 0 and the length
of bv. The bits
of bv corresponding to the indexes in uve are set to
bool. The return value is unspecified.
 Scheme Procedure: bitcount* v kv obj

 C Function: scm_bit_count_star (v, kv, obj)
 Return
 (bitcount (bitset*! (if bool bv (bitinvert! bv)) uve #t) #t).

bv is not modified.