17.1 Character set
Characters usable in the SML# language are extended ASCII characters from to (in decimal). Key words and delimiters are among the characters from through . Identifiers may ASCII characters from to , including 8-bit characters from to , as far as they are not overlap with keywords and delimiters. This rule allows the programmer to use UTF8 encoded Japanese (and other) character string as identifiers. The following interactive session show example codes with Japanese identifiers.
$ smlsharp
SML# 4.0.0 ...
# datatype メンバー =
> 研究員 of {氏名:string, 年齢:int, 学位:string}
> | 職員 of {氏名:string, 年齢:int};
datatype メンバー =
研究員 of {学位:string, 年齢:int, 氏名:string}
| 職員 of {年齢:int, 氏名:string}
# 研究員 {学位="Ph.D.", 年齢=21, 氏名="大堀"};
val it =
研究員 {学位 = "Ph.D.",年齢 = 21,氏名 = "大堀"} : メンバー