<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Occam (programming language) - Page 6 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=occam_(programming_language)&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=occam_%28programming_language%29&amp;p=7">3.Next</a>
</p>
<p>   p()    q()</p>

<p><code>ALT</code> specifies a list of <a href="page.php?w=Guard_%28computer_science%29">guarded</a> commands. The guards are a combination of a Boolean condition and an input expression, both optional. Each guard for which the condition is true and the input channel is ready is successful. One of the successful alternatives is selected for execution. Example:</p>

<p>  ALT    count1 < 100 & c1 ? data      SEQ        count1 := count1 + 1        merged ! data    count2 < 100 & c2 ? data      SEQ        count2 := count2 + 1        merged ! data    status ? request      SEQ        out ! count1        out ! count2</p>

<p>This will read data from channels c1 or c2 (whichever is ready) and pass it into a merged channel. If countN reaches 100, reads from the corresponding channel will be disabled. A request on the status channel is answered by outputting the counts to <code>out</code>.</p>

<p><big>Language revisions</big></p>
<p><big>occam 1</big></p>
<p>occam 1 (released 1983) was a preliminary version of the language which borrowed from <a href="page.php?w=David_May_%28computer_scientist%29">David May</a>'s work on EPL and Tony Hoare's CSP. This supported only the VAR <a href="page.php?w=data_type">data type</a>, which was an integral type corresponding to the native word length of the target architecture, and arrays of only one dimension.</p>

<p><big>occam 2</big></p>
<p>occam 2 is an extension produced by Inmos Ltd in 1987 that adds <a href="page.php?w=floating-point">floating-point</a> support, functions, multi-dimensional arrays and more data types such as varying sizes of integers (INT16, INT32) and bytes.</p>

<p>With this revision, occam became a language able to express useful programs, whereas occam 1 was more suited to examining algorithms and exploring the new language (however, the occam 1 <a href="page.php?w=compiler">compiler</a> was written in occam 1, so there is an existence proof that reasonably sized, useful programs could be written in occam 1, despite its limits).</p>

<p><big>occam 2.1</big></p>
<p>occam 2.1 was the last of the series of occam language developments contributed by Inmos. Defined in 1994, it was influenced by an earlier proposal for an <b>occam 3</b> language (also referred to as "occam91" during its early development) created by Geoff Barrett at Inmos in the early 1990s. A revised Reference Manual describing occam 3 was distributed for community comment, but the language was never fully implemented in a compiler.</p>

<p>occam 2.1 introduced several new features to occam 2, including:<br/>
*Named data types (DATA TYPE x IS y)<br/>
*Named records<br/>
*Packed records<br/>
*Relaxation of some of the <a href="page.php?w=type_conversion">type conversion</a> rules<br/>
*New operators (e.g. BYTESIN)<br/>
*Channel retyping and channel arrays<br/>
*Ability to return fixed-length array from function.</p>

<p>For a full list of the changes see Appendix P of the .</p>

<p><big>occam-?</big></p>
<p><a href="page.php?w=occam-%3F">occam-?</a> is the common name for the occam variant implemented by later versions of the Kent Retargetable occam Compiler (<a href="page.php?w=KRoC">KRoC</a>). The addition of the symbol <a href="page.php?w=Pi_%28letter%29">?</a> (pi) to the occam name is an allusion to KRoC occam including several ideas inspired by the <a href="page.php?w=%3F-calculus">?-calculus</a>. It contains several significant extensions to the occam 2.1 compiler, for example:<br/>
*<a href="page.php?w=Nesting_%28computing%29">Nested</a> <a href="page.php?w=Protocol_%28object-oriented_programming%29">protocols</a><br/>
*Run-time process creation<br/>
*Mobile channels, data, and processes<br/>
*<a href="page.php?w=Recursion_%28computer_science%29">Recursion</a><br/>
*Protocol <a href="page.php?w=Inheritance_%28object-oriented_programming%29">inheritance</a><br/>
*Array <a href="page.php?w=Constructor_%28object-oriented_programming%29">constructors</a><br/>
*Extended <a href="page.php?w=Barrier_%28computer_science%29">rendezvous</a></p>

<p><big>See also</big></p>
<p>
* <a href="page.php?w=Concurrent_computing">Concurrent programming languages</a><br/>
* <a href="page.php?w=List_of_concurrent_and_parallel_programming_languages">List of concurrent and parallel programming languages</a></p>

<p><big>References</big></p>
<p><big>Further reading</big></p>
<p>
*  <br/>
*  <br/>
*  <br/>
*<br/>
*<br/>
*Egorov, A., Technical University - Sofia, (1983-2011) <b>??????? ?? ?????????? ???????????</b></p>

<p><big> External links </big></p>
<p>
* <br/>
*  (no longer maintained)<br/>
* <br/>
* .<br/>
*  - (translator from occam to C from Kent) a Haskell-based compiler for occam and related languages.</p>

<p></p>
<p>
<a accesskey="1" href="page.php?w=occam_(programming_language)&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=occam_%28programming_language%29&amp;p=7">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
