On Tue, 22 Apr 2003, Philip Warner wrote:
> Having just used bit strings for the first time, I am now aware of some
> features I consider a little odd, and was wondering if (a) they are
> actively being worked on, (b) if they are not considered the way to go, and
> (c) if there would be any interest in the additions/changes indicated below.
>
> 1. Length enforcement:
> ----------------------
>
> select B'10' | B'1';
>
> is currently illegal.
>
> ISTM we should return B'11' for this. ie. build the smallest varbit that
> contains the result, and return it.
ISTM that the answer would be closer to B'10' according to the spec. The
spec asks for right extension by 0 when casting to a larger size fixed bit
string.
> 3. extract_bits
> ---------------
>
> extract_bits(varbit bits, int from, int to) returns varbit
>
> would seem useful.
I think substring is the way to do this.