<!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>SMLofNJStructure</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>SMLofNJStructure</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">signature</span><span class="w"> </span><span class="n">SML_OF_NJ</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">   </span><span class="k">sig</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Cont</span><span class="p">:</span><span class="w"></span>
<span class="w">         </span><span class="k">sig</span><span class="w"></span>
<span class="w">            </span><span class="k">type</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">cont</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">callcc</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="n">cont</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">isolate</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">cont</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">throw</span><span class="p">:</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">cont</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;b</span><span class="w"></span>
<span class="w">         </span><span class="k">end</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">SysInfo</span><span class="p">:</span><span class="w"></span>
<span class="w">         </span><span class="k">sig</span><span class="w"></span>
<span class="w">            </span><span class="k">exception</span><span class="w"> </span><span class="n">UNKNOWN</span><span class="w"></span>
<span class="w">            </span><span class="k">datatype</span><span class="w"> </span><span class="n">os_kind</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">BEOS</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="n">MACOS</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="n">OS2</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="n">UNIX</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="n">WIN32</span><span class="w"></span>

<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">getHostArch</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">getOSKind</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">os_kind</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">getOSName</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"></span>
<span class="w">         </span><span class="k">end</span><span class="w"></span>

<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">exnHistory</span><span class="p">:</span><span class="w"> </span><span class="n">exn</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">list</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">exportFn</span><span class="p">:</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="p">(</span><span class="n">string</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">list</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">OS</span><span class="p">.</span><span class="n">Process</span><span class="p">.</span><span class="n">status</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">exportML</span><span class="p">:</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">bool</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">getAllArgs</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">list</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">getArgs</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">list</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">getCmdName</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">string</span><span class="w"></span>
<span class="w">   </span><span class="k">end</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p><span class="monospaced">SMLofNJ</span> implements a subset of the structure of the same name
provided in <a href="SMLNJ">Standard ML of New Jersey</a>.  It is included to
make it easier to port programs between the two systems.  The
semantics of these functions may be different than in SML/NJ.</p></div>
<div class="ulist"><ul>
<li>
<p>
<span class="monospaced">structure Cont</span>
</p>
<div class="paragraph"><p>implements continuations.</p></div>
</li>
<li>
<p>
<span class="monospaced">SysInfo.getHostArch ()</span>
</p>
<div class="paragraph"><p>returns the string for the architecture.</p></div>
</li>
<li>
<p>
<span class="monospaced">SysInfo.getOSKind</span>
</p>
<div class="paragraph"><p>returns the OS kind.</p></div>
</li>
<li>
<p>
<span class="monospaced">SysInfo.getOSName ()</span>
</p>
<div class="paragraph"><p>returns the string for the host.</p></div>
</li>
<li>
<p>
<span class="monospaced">exnHistory</span>
</p>
<div class="paragraph"><p>the same as <span class="monospaced">MLton.Exn.history</span>.</p></div>
</li>
<li>
<p>
<span class="monospaced">getCmdName ()</span>
</p>
<div class="paragraph"><p>the same as <span class="monospaced">CommandLine.name ()</span>.</p></div>
</li>
<li>
<p>
<span class="monospaced">getArgs ()</span>
</p>
<div class="paragraph"><p>the same as <span class="monospaced">CommandLine.arguments ()</span>.</p></div>
</li>
<li>
<p>
<span class="monospaced">getAllArgs ()</span>
</p>
<div class="paragraph"><p>the same as <span class="monospaced">getCmdName()::getArgs()</span>.</p></div>
</li>
<li>
<p>
<span class="monospaced">exportFn f</span>
</p>
<div class="paragraph"><p>saves the state of the computation to a file that will apply <span class="monospaced">f</span> to
the command-line arguments upon restart.</p></div>
</li>
<li>
<p>
<span class="monospaced">exportML f</span>
</p>
<div class="paragraph"><p>saves the state of the computation to file <span class="monospaced">f</span> and continue.  Returns
<span class="monospaced">true</span> in the restarted computation and <span class="monospaced">false</span> in the continuing
computation.</p></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>
