c-cube/ocaml-containers

Semantics of CCBV.resize

favonia opened this issue · 2 comments

I am confused by the current code.

  1. Should this be true or false? Current, it returns true.
let bv = CCBV.create ~size:3 true in CCBV.resize bv 1; CCBV.get bv 2
  1. Should this be exception-free? Current, it raises an exception.
let bv = CCBV.create ~size:1 true in CCBV.resize bv 0

is this still relevant?

I just skimmed through the code and I suppose the new code does what's expected (that is, it does seem to clear higher bits and does not seem to complain about the zero size).