DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) Bit Vectors

Info Catalog (guile.info.gz) Uniform Arrays (guile.info.gz) Arrays
 
 22.6.4 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
 
  -- Scheme Procedure: bit-count b bitvector
  -- C Function: scm_bit_count (b, bitvector)
      Return the number of occurrences of the boolean B in BITVECTOR.
 
  -- Scheme Procedure: bit-position 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: bit-invert! v
  -- C Function: scm_bit_invert_x (v)
      Modify BV by replacing each element with its negation.
 
  -- Scheme Procedure: bit-set*! v kv obj
  -- C Function: scm_bit_set_star_x (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 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: bit-count* v kv obj
  -- C Function: scm_bit_count_star (v, kv, obj)
      Return
           (bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
      BV is not modified.
 
Info Catalog (guile.info.gz) Uniform Arrays (guile.info.gz) Arrays
automatically generated byinfo2html