1 type t = { length : int;
6 bits = String.make (1 + size / 8) '\000'
12 (((Char.code (String.unsafe_get v.bits i)) lsr j) land 1) == 1
15 let unsafe_set v n (b:bool) =
16 let x : int = Obj.magic b in
20 let w = Char.code (String.unsafe_get v.bits i) in
21 let w = (w land lnot m) lor (~-x land m) in
22 String.unsafe_set v.bits i (Char.unsafe_chr (w land 0xff))
26 if n < 0 || n >= v.length then failwith "Bitvector.get"
31 if n < 0 || n >= v.length then failwith "Bitvector.set"