let print_optional_field (x:optional_field) =
let typ,value = match x.value with
| `A x -> 'A', Char.to_string x
| `i x -> 'i', Int32.to_string x
| `f x -> 'f', Float.to_string x
| `Z x -> 'Z', x
| `H x -> 'H', x
| `B (c,l) -> 'B', (String.concat ~sep:"," ((String.of_char c)::l))
in
sprintf "%s:%c:%s" x.tag typ value