blob: 9a106f2923db448a8ab6414819396db3531ca8cc [file] [log] [blame]
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../css/ot.css" />
<link rel="stylesheet" type="text/css" href="../css/otjld.css" />
<title>OT/J Language Definition v1.3</title>
</head>
<body class="otdt">
<div id="content">
<table class="nav">
<tr>
<td class="back"><a id="top"></a><a href="sA.6.html" rel="prev">&lt;&lt;&nbsp;&sect;A.6&nbsp;Types</a></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="sA.8.html" rel="next">&sect;A.8&nbsp;Precedence declaration&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
<div class="sect depth2" id="sA.7">
<h2 class="sect">&sect;A.7&nbsp;Guard predicates<a class="img" href="sA.7.html"
title="PermaLink to &sect;A.7&nbsp;Guard predicates"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
alt="" /></a></h2>
<table class="syntaxrule" id="sA.7.1">
<tr>
<td class="sect">&sect;&nbsp;A.7.1</td>
<td class="rule"><span class="title">Guard</span><br /><strong class="blue"><em>[</em>base<em>]</em> when</strong> ( <em>Expression</em> )
</td>
</tr>
</table>
<table class="syntaxrule" id="sA.7.2">
<tr>
<td class="sect">&sect;&nbsp;A.7.2</td>
<td class="rule"><span class="title">MethodDeclaration</span><br />...<br /><em>MethodHeader <strong class="blue">[Guard]</strong> MethodBody</em></td>
</tr>
</table>
<p>Other rules referring to <em><code>Guard</code></em>:
<a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
class="sect">ClassDeclaration (&sect;A.1.1)</a>,
<a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">CallinBinding (&sect;A.3.3)</a></p>
<div class="constraints">
<h5 class="constraints">Contextual constraints:</h5>
<ol class="constraints">
<li>The <code>Expression</code> in a guard must have type <code>boolean</code>.
</li>
</ol>
</div>
</div>
<table class="nav">
<tr>
<td class="back"><a href="sA.6.html" rel="prev">&lt;&lt;&nbsp;&sect;A.6&nbsp;Types</a></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="sA.8.html" rel="next">&sect;A.8&nbsp;Precedence declaration&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
</div>
<div id="footer">
<hr /><a class="w3c img" href="http://jigsaw.w3.org/css-validator/check/referer"
shape="rect"><img src="../images/valid-css2-blue.png" alt="Valid CSS!" height="31" width="88" /></a><a class="w3c img" href="http://validator.w3.org/check?uri=referer" shape="rect"><img src="../images/valid-xhtml10-blue.png" alt="Valid XHTML 1.0 Strict" height="31"
width="88" /></a><address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
OT/J version 1.3 &mdash; last modified: 2011-05-15
</div>
</body>
</html>