Here are some functions that relate to bit vectors:
This function returns
tif object is a bit vector.(bit-vector-p #*01) ⇒ t (bit-vector-p [0 1]) ⇒ nil (bit-vector-p "01") ⇒ nil
This function creates and returns a bit vector whose elements are the arguments bits. Each argument must be a bit, i.e. one of the two integers 0 or 1.
(bit-vector 0 0 0 1 0 0 0 0 1 0) ⇒ #*0001000010 (bit-vector) ⇒ #*
This function creates and returns a bit vector consisting of length elements, each initialized to bit, which must be one of the two integers 0 or 1.
(setq picket-fence (make-bit-vector 9 1)) ⇒ #*111111111
This function returns a new bit vector containing all the elements of the sequences. The arguments sequences may be lists, vectors, or bit vectors, all of whose elements are the integers 0 or 1. If no sequences are given, an empty bit vector is returned.
The value is a newly constructed bit vector that is not
eqto any existing bit vector.(setq a (bvconcat '(1 1 0) '(0 0 1))) ⇒ #*110001 (eq a (bvconcat a)) ⇒ nil (bvconcat) ⇒ #* (bvconcat [1 0 0 0 0] #*111 '(0 0 0 0 1)) ⇒ #*1000011100001For other concatenation functions, see
mapconcatin Mapping Functions,concatin Creating Strings,vconcatin Vector Functions, andappendin Building Lists.
The append function provides a way to convert a bit vector into a
list with the same elements (see Building Lists):
(setq bv #*00001110)
⇒ #*00001110
(append bv nil)
⇒ (0 0 0 0 1 1 1 0)