<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.26">
<title>SMLofNJStructure</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<link rel="stylesheet" href="./asciidoctor.css">
<link rel="stylesheet" href="./mlton.css">

</head>
<body class="article">
<div id="mlton-header">
<div id="mlton-header-text">
<h2>
<a href="./Home">
MLton
20241230+git20251029+dfsg-5
</a>
</h2>
</div>
</div>
<div id="header">
<h1>SMLofNJStructure</h1>
</div>
<div id="content">
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sml">signature SML_OF_NJ =
   sig
      structure Cont:
         sig
            type 'a cont
            val callcc: ('a cont -&gt; 'a) -&gt; 'a
            val isolate: ('a -&gt; unit) -&gt; 'a cont
            val throw: 'a cont -&gt; 'a -&gt; 'b
         end
      structure SysInfo:
         sig
            exception UNKNOWN
            datatype os_kind = BEOS | MACOS | OS2 | UNIX | WIN32

            val getHostArch: unit -&gt; string
            val getOSKind: unit -&gt; os_kind
            val getOSName: unit -&gt; string
         end

      val exnHistory: exn -&gt; string list
      val exportFn: string * (string * string list -&gt; OS.Process.status) -&gt; unit
      val exportML: string -&gt; bool
      val getAllArgs: unit -&gt; string list
      val getArgs: unit -&gt; string list
      val getCmdName: unit -&gt; string
   end</code></pre>
</div>
</div>
<div class="paragraph">
<p><code>SMLofNJ</code> 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><code>structure Cont</code></p>
<div class="paragraph">
<p>implements continuations.</p>
</div>
</li>
<li>
<p><code>SysInfo.getHostArch ()</code></p>
<div class="paragraph">
<p>returns the string for the architecture.</p>
</div>
</li>
<li>
<p><code>SysInfo.getOSKind</code></p>
<div class="paragraph">
<p>returns the OS kind.</p>
</div>
</li>
<li>
<p><code>SysInfo.getOSName ()</code></p>
<div class="paragraph">
<p>returns the string for the host.</p>
</div>
</li>
<li>
<p><code>exnHistory</code></p>
<div class="paragraph">
<p>the same as <code>MLton.Exn.history</code>.</p>
</div>
</li>
<li>
<p><code>getCmdName ()</code></p>
<div class="paragraph">
<p>the same as <code>CommandLine.name ()</code>.</p>
</div>
</li>
<li>
<p><code>getArgs ()</code></p>
<div class="paragraph">
<p>the same as <code>CommandLine.arguments ()</code>.</p>
</div>
</li>
<li>
<p><code>getAllArgs ()</code></p>
<div class="paragraph">
<p>the same as <code>getCmdName()::getArgs()</code>.</p>
</div>
</li>
<li>
<p><code>exportFn f</code></p>
<div class="paragraph">
<p>saves the state of the computation to a file that will apply <code>f</code> to
the command-line arguments upon restart.</p>
</div>
</li>
<li>
<p><code>exportML f</code></p>
<div class="paragraph">
<p>saves the state of the computation to file <code>f</code> and continue.  Returns
<code>true</code> in the restarted computation and <code>false</code> in the continuing
computation.</p>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>