<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>Identifier</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>Identifier</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>In <a href="StandardML">Standard ML</a>, there are syntactically two kinds of
identifiers.</p></div>
<div class="ulist"><ul>
<li>
<p>
Alphanumeric: starts with a letter or prime (<span class="monospaced">'</span>) and is followed by letters, digits, primes and underbars (<span class="monospaced">_</span>).
</p>
<div class="paragraph"><p>Examples: <span class="monospaced">abc</span>, <span class="monospaced">ABC123</span>, <span class="monospaced">Abc_123</span>, <span class="monospaced">'a</span>.</p></div>
</li>
<li>
<p>
Symbolic: a sequence of the following
</p>
<div class="listingblock">
<div class="content monospaced">
<pre> ! % &amp; $ # + - / : &lt; = &gt; ? @ | ~ ` ^ | *</pre>
</div></div>
<div class="paragraph"><p>Examples: <span class="monospaced">+=</span>, <span class="monospaced">&lt;=</span>, <span class="monospaced">&gt;&gt;</span>, <span class="monospaced">$</span>.</p></div>
</li>
</ul></div>
<div class="paragraph"><p>With the exception of <span class="monospaced">=</span>, reserved words can not be identifiers.</p></div>
<div class="paragraph"><p>There are a number of different classes of identifiers, some of which
have additional syntactic rules.</p></div>
<div class="ulist"><ul>
<li>
<p>
Identifiers not starting with a prime.
</p>
<div class="ulist"><ul>
<li>
<p>
value identifier (includes variables and constructors)
</p>
</li>
<li>
<p>
type constructor
</p>
</li>
<li>
<p>
structure identifier
</p>
</li>
<li>
<p>
signature identifier
</p>
</li>
<li>
<p>
functor identifier
</p>
</li>
</ul></div>
</li>
<li>
<p>
Identifiers starting with a prime.
</p>
<div class="ulist"><ul>
<li>
<p>
type variable
</p>
</li>
</ul></div>
</li>
<li>
<p>
Identifiers not starting with a prime and numeric labels (<span class="monospaced">1</span>, <span class="monospaced">2</span>, &#8230;).
</p>
<div class="ulist"><ul>
<li>
<p>
record label
</p>
</li>
</ul></div>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
