GNU Info

Info Node: (guile.info)Bit Vectors

(guile.info)Bit Vectors


Prev: Uniform Arrays Up: Arrays
Enter node , (file) or (file)node

Bit Vectors
-----------

Bit vectors are a specific type of uniform array: an array of booleans
with a single zero-based index.

They are displayed as a sequence of `0's and `1's prefixed by `#*',
e.g.,

     (make-uniform-vector 8 #t #f) =>
     #*00000000
     
     #b(#t #f #t) =>
     #*101

 - primitive: bit-count b bitvector
     Returns the number of occurrences of the boolean B in BITVECTOR.

 - primitive: bit-position item v k
     Returns 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.

 - primitive: bit-invert! v
     Modifies BV by replacing each element with its negation.

 - primitive: bit-set*! v kv obj
     If uve is a bit-vector 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 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.

 - primitive: bit-count* v kv obj
     Returns
          (bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
     BV is not modified.


automatically generated by info2www version 1.2.2.9