in reply to Re^2: unpacking variable length bit fields
in thread unpacking variable length bit fields

I know what you mean. You want to be able to replace all the As with Bs and skip the first step, but of course each B starts a new byte. Maybe there could be something like unpack 'B{3,2,2,1}B{4,2,1,1}B{2,2,1,1,2}', $x?

I've also had occassion to want to extract bit-ranges that cross byte boundaries and that gets real messy. Maybe an enhanced vec that allows non-powers-of-two sizes. That shouldn't be so hard to write.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.