Perry E. Metzger
Perry E. Metzger
(BTW, what's a reasonable temporary workaround?)
I can submit a PR for `Uchar.t`, but we need to decide on a printed representation that we're comfortable with. (That is to say, can someone suggest a color for...
That latter suggestion isn't far from what @Drup suggested, though figuring out what's printable given only the tools in the stdlib isn't easy, so it might need to default to...
`U+HHHH` seems problematic because it can't be a valid OCaml read syntax ever, at least not without nasty special casing.
> You can conservatively stick to ASCII. 0x20..0x7E? Sorry, can you expand on that?
@hcarty btw, in your example: ```ocaml let pp_uc pp uc = ... ``` I am guessing the `uc` is the actual Uchar.t, but what's the `pp` argument?
My current prototype is: ```ocaml let pp_uchar f uc = let ui = Uchar.to_int uc in if ui < 128 then Format.fprintf f "(Uchar.of_char '%s')" (Char.escaped (Uchar.to_char uc)) else Format.fprintf...
Why? Tab is better expressed as `'\t'` etc.
(I can see suggesting that things other than `\t`, `\n`, `\r` etc. should be expressed in the "normal" way though.)
One suggestion for an OCaml Uchar.t direct syntax that’s evolved on the discord channel: ``` let pi : Uchar.t = \u'π' ``` (for direct entry of Unicode chars in source)...