Urban Hafner : Tag wait, everything about wait http://bettong.net/tag/wait.rss en-us 40 CTM: Exercise 4-5 <h3>The problem</h3> <p><em>The <code>Wait</code> operation.</em> Explain why the <code>{Wait X}</code> operation could be defined as:</p> <div class="typocode"><pre><code class="typocode_default ">proc {Wait X} if X==unit then skip else skip end end</code></pre></div> <p>Use your understanding of the dataflow behavior of the <strong>if</strong> statement and <code>==</code> operation.</p> <h3>My solution</h3> <p>The idea of <code>Wait</code> is to wait until its argument become bound. The <code>==</code> (i.e. the entailment check) is used to make the procedure wait. The <strong>if</strong> statement is needed, because <code>==</code> returns a value but <code>Wait</code> doesn&#8217;t. To get rid of this value you simply wrap the call to <code>==</code> in an <strong>if</strong> statement and let the <strong>if</strong> return nothing.</p> Wed, 02 Nov 2005 16:13:41 +0000 urn:uuid:16ae32ca-247e-48cb-af53-3053f532f9e5 urban@bettong.net (Urban Hafner) http://bettong.net/2005/11/02/ctm-exercise-4-5#comments CTM exercise book mozart oz dataflow wait http://bettong.net/2005/11/02/ctm-exercise-4-5