| 1 |
= Identifier |
| 2 |
|
| 3 |
In <<StandardML#,Standard ML>>, there are syntactically two kinds of |
| 4 |
identifiers. |
| 5 |
|
| 6 |
* Alphanumeric: starts with a letter or prime (`'`) and is followed by letters, digits, primes and underbars (`_`). |
| 7 |
+ |
| 8 |
Examples: `abc`, `ABC123`, `Abc_123`, `'a`. |
| 9 |
|
| 10 |
* Symbolic: a sequence of the following |
| 11 |
+ |
| 12 |
---- |
| 13 |
! % & $ # + - / : < = > ? @ | ~ ` ^ | * |
| 14 |
---- |
| 15 |
+ |
| 16 |
Examples: `+=`, `\<=`, `>>`, `$`. |
| 17 |
|
| 18 |
With the exception of `=`, reserved words can not be identifiers. |
| 19 |
|
| 20 |
There are a number of different classes of identifiers, some of which |
| 21 |
have additional syntactic rules. |
| 22 |
|
| 23 |
* Identifiers not starting with a prime. |
| 24 |
** value identifier (includes variables and constructors) |
| 25 |
** type constructor |
| 26 |
** structure identifier |
| 27 |
** signature identifier |
| 28 |
** functor identifier |
| 29 |
* Identifiers starting with a prime. |
| 30 |
** type variable |
| 31 |
* Identifiers not starting with a prime and numeric labels (`1`, `2`, ...). |
| 32 |
** record label |