[MLton] WideChar.{chr,ord}

Matthew Fluet fluet@cs.cornell.edu
Sat, 26 Nov 2005 10:47:23 -0500 (EST)


> WideChar.{chr,ord} convert back and forth between an 'int' and 'char'. 
> Great. Char4 won't fit! I wish I'd realized this earlier...

It fits if  int == IntInf.int.  This is a general problem with the Basis 
Library not specifying the 'default' int size.

> Char{1,2,4} sound like they're out.
> Maybe Char{8,16,21} would be better.

I never understood the motivation for the Char{1,2,4} naming scheme, when 
Int<N> and Word<N> measured the bit-size.

> However, the standard forbids this: The optional WideChar structure 
> defines wide characters, which are represented by a fixed number of 
> 8-bit words (bytes)

I think this is a place where we can reasonably break from the standard, 
since it was not designed with WideChar in mind.

> However, if Char is really ISO-8559-1, then the
> definition of is{Alpha,...} is wrong for Char!!!

How so?  There are ISO-8559-1 characters that are neither upper nor lower?

> WideChar sounded so straight-forward when I started
> this, but it's really causing me a headache. I don't think
> it is possible to have an implementation that conforms
> to both the basis and unicode rules.

Again, I think we follow Unicode rules over the Basis standard.

> I think I'm going to start begging people to make a few
> modifications on sml-basis-discuss...

That's a good place to open up discussion.