blob: c5f00c73659282b3e0a383a384791214ef494d5e [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="s4.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(a)&nbsp;General case parameter mapping</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="s4.4.c.html" rel="next">&sect;4.4.(c)&nbsp;Mapping the result of a base method&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
<div class="subsect depth3" id="s4.4.b">
<h4 class="subsect">&sect;4.4.(b)&nbsp;<span class="title">Restrictions for callin replace bindings</span><a class="img" href="s4.4.b.html"
title="PermaLink to (b)&nbsp;Restrictions for callin replace bindings"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
alt="" /></a></h4>
<p>The right-hand side of a parameter mapping may either be
the simple name of a base method argument without further computation,
or an arbitrary expression <em>not</em> containing any base method argument.
<br />
Each base method argument must either appear as a simple name in exactly one parameter mapping
or not be mapped at all. In the latter case, the original argument is "tunneled" to
the base call, meaning, the callin method does not see the argument, but it is passed
to the base method as expected.
<br />
If the base method declares a result, then
</p>
<ul>
<li>if the role method also declares a result, <code>result</code> must be mapped to itself:
<br /><code>result -&gt; result</code></li>
<li>if the role method does not declare a result, an arbitrary expression may be mapped to result:
<br /><code><em>expression</em> -&gt; result</code><br />
If in this situation no result mapping exists, the result of the base call
is "tunneled" and passed to the original caller (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
class="sect">
fragile callin binding (&sect;4.3.(e))</a> above).
</li>
</ul>
<p>These rules ensure that these bindings are reversible
for the sake of base calls (<a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
</p>
<p>As stated above a fragile callin binding (<a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
class="sect">&sect;4.3.(e)</a>)
is not allowed with a callin method that definitely has no base call
(<a href="s4.3.b.html" title="&sect;4.3.(b)&nbsp;Missing base call"
class="sect">&sect;4.3.(b)</a>). A callin replace binding is not fragile if it provides
the base result using a result mapping.
</p>
<p>A callin method bound with replace to a base method returning
void must not declare a non-void result.
</p>
</div>
<table class="nav">
<tr>
<td class="back"><a href="s4.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(a)&nbsp;General case parameter mapping</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="s4.4.c.html" rel="next">&sect;4.4.(c)&nbsp;Mapping the result of a base method&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</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: 2010-05-18
</div>
</body>
</html>