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