[MLton] should a character constant's value affect its default type?
Fri, 10 Dec 2004 16:37:54 -0800
I'm working on the front-end support for WideChar and WideString, and
I wonder if we should allow the values of character constants affect
their default type. For example, #"\u1234" clearly denotes either a
Char2.char or a Char4.char. However, the default type is char, which
means that a compile-time character-out-of-range error will be reported.
Similarly, #"\U00012345" clearly denotes a Char4.char.
The Definition is silent on this issue as far as I can tell. It
says that the surrounding context should be used to resolve the type,
but it's not clear if that rules out the constant itself.
My gut feeling is to ignore the character values, since this is
similar to how we treat integers and words.