Yes, this is possible. The syntax currently is slightly different,
ie. you have to write something like this:
bitmatch bstring with
| { 0 : 1; 0 : 1; 0 : 1; 0 : 1; 0 : 1 } -> (* the 00000 case *)
| (* etc *)
or:
bitmatch bstring with
| { 0b00000 : 5 } -> (* the 00000 case *)
| { 0b11111 : 5 } -> (* the 11111 case *)
| { 1 : 1; _ : 1; _ : 1; _ : 1; 0 : 1 } -> (* the 1____0 case *)
| (* etc *)
That third case could also be written as:
| { 1 : 1; _ : 3; 0 : 1 } -> ...
A more compact syntax might be invented for bitstrings like this, but
I'm not sure what would be a good syntax here.
Rich.
--
Richard Jones
Red Hat