[MLton] WideChar

Wesley W. Terpstra terpstra@gkec.tu-darmstadt.de
Sat, 11 Dec 2004 00:53:35 +0100


On Fri, Dec 10, 2004 at 04:22:19PM -0600, Henry Cejtin wrote:
> With  regards  to  locale dependency, isn't one of the huge points of
> unicode exactly that isAlpha and isPrint do NOT depend on things like
> locale.

I need to read up more about Unicode here.

> I have been pimped MANY times by code that depends on the locale  because
> it pretty much ONLY makes sense when the output is to a human or the input
> is from a human.  When things are between programs it is a disaster if the
> two programs don't agree.

That's why I proposed to leave Char.is* as fixed.

Best would be to follow the Unicode definition of isUpper and isLower like
you said. I believe it probably agrees with SML's existing isUpper and
isLower for the ASCII set. However, I am not certain isUpper makes sense
in all locales.

What to do about WideChar.toUpper? Yuck yuck yuck.
Throw an exception for ord x >= 128?

As for locales, this is where I get more fuzzy about what they should
include myself. Number and date formatting are certainly in there, as is
the written language to use with the user.

I'm not sure what else should go in. 
It may make sense that isPrintable and possibly other is* functions be
localizable. I'm not sure.

-- 
Wesley W. Terpstra <wesley@terpstra.ca>