Using Unicode identifiers would improve the clarity of programs, in particular for teaching purposes.
According to Xavier Leroy, it would not be too difficult to add support for Unicode identifiers in OCaml. The easiest way would be to reuse Java's specifications regarding the definition of uppercase letters, lowercase letters, etc. The two questions that Java's specifications do not answer are
- the definition of symbol characters -- the kind of characters OCaml uses for identifiers
- the precedence of these identifiers.
Java specifications : Spec page, Character.isJavaIdentifierPart
- Which characters should be considered symbols and accepted for infix identifiers ?
- What should be the relative priority of each identifier ?
Infix precedence and associativity
Current precedence and associativity of OCaml infix identifiers are specified by their beginning symbols, as specified in the manual.
We could :
- conservatively keep the rules as they are now;
- conservatively keep the rules as they are now and use a Camlp4 extension (preferably bundled with the compiler) to allow the definition of infixes with given precedence/associativity rules (vote: 1);
- add some more symbols, specifying new precedence/associativity rules;
- use completely different rules.
Express yourselves here