blob: 81e656ff433fc945ba23407d9de69d014eb6d557 [file] [log] [blame]
Stephan Herrmann01664412010-04-01 20:28:43 +00001<!DOCTYPE html
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Stephan Herrmann01664412010-04-01 20:28:43 +00006 <link rel="stylesheet" type="text/css" href="../css/ot.css" />
7 <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
8 <title>OT/J Language Definition v1.3</title>
9 </head>
10 <body class="otdt">
11 <div id="content">
12 <table class="nav">
13 <tr>
14 <td class="back"><a id="top"></a><a href="s3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2&nbsp;Callout parameter mapping</a></td>
15 <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
16 <td class="next"><a href="s3.4.html" rel="next">&sect;3.4&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
17 </tr>
18 </table>
19 <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
20 <div class="sect depth2" id="s3.3">
Stephan Herrmann109893e2010-05-18 22:02:53 +000021 <h2 class="sect">&sect;3.3&nbsp;Lifting and lowering<a class="img" href="s3.3.html"
22 title="PermaLink to &sect;3.3&nbsp;Lifting and lowering"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
23 alt="" /></a></h2>
Stephan Herrmann01664412010-04-01 20:28:43 +000024 <p> (For basic definitions see <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
25
26 </p>
27 <div class="subsect depth3" id="s3.3.a">
Stephan Herrmann109893e2010-05-18 22:02:53 +000028 <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span><a class="img" href="s3.3.a.html"
29 title="PermaLink to (a)&nbsp;Call target translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
30 alt="" /></a></h4>
Stephan Herrmann01664412010-04-01 20:28:43 +000031 <p>Invoking a base method due to a callout binding first
32 <strong>lowers</strong> the role object in order to obtain the effective call target.
33
34 </p>
35 </div>
36 <div class="subsect depth3" id="s3.3.b">
Stephan Herrmann109893e2010-05-18 22:02:53 +000037 <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span><a class="img" href="s3.3.b.html"
38 title="PermaLink to (b)&nbsp;Parameter translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
39 alt="" /></a></h4>
Stephan Herrmann01664412010-04-01 20:28:43 +000040 <p>Passing a role object as parameter to a callout method implicitly <strong>lowers</strong>
41 this parameter, if the base method declares a corresponding base type parameter.
42 <br />
43 Lifting of callout parameters is not possible.
44
45 </p>
46 </div>
47 <div class="subsect depth3" id="s3.3.c">
Stephan Herrmann109893e2010-05-18 22:02:53 +000048 <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span><a class="img" href="s3.3.c.html"
49 title="PermaLink to (c)&nbsp;Result translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
50 alt="" /></a></h4>
Stephan Herrmann01664412010-04-01 20:28:43 +000051 <p> When returning a base object from a callout method where the role
52 method declares the result to be of a role class,
53 this object is implicitly <strong>lifted</strong> to the appropriate role.
54 <br />
55 Lowering the result of a callout binding is not possible.
56
57 </p>
58 </div>
59 <div class="subsect depth3" id="s3.3.d">
Stephan Herrmann109893e2010-05-18 22:02:53 +000060 <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span><a class="img" href="s3.3.d.html" title="PermaLink to (d)&nbsp;Typing rules"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
61 alt="" /></a></h4>
Stephan Herrmann01664412010-04-01 20:28:43 +000062 <p>A parameter mapping (implicit by parameter position or explicit
63 by a <code>with</code> clause) is <strong>well typed</strong> if
64 the left hand side conforms to the right hand side, either by
65
66 </p>
67 <ul>
68 <li>type equality</li>
69 <li>implicit primitive type conversion</li>
70 <li>subtype polymorphism</li>
71 <li>translation polymorphism, here: <em>lowering</em>,
72 </li>
73 <li><em>or</em> by a combination of the above.
74 </li>
75 </ul>
76 <p>A result mapping (implicit or explicit by a <code>with</code> clause)
77 is well typed, if the value at the right hand side conforms to the
78 left hand side according to the rules given above, except that
79 translation polymorphism here applies <em>lifting</em> instead of
80 lowering.
81
82 </p>
83 </div>
84 <div class="subsect depth3" id="s3.3.e">
Stephan Herrmann109893e2010-05-18 22:02:53 +000085 <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span><a class="img" href="s3.3.e.html" title="PermaLink to (e)&nbsp;Role arrays"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
86 alt="" /></a></h4>
Stephan Herrmann01664412010-04-01 20:28:43 +000087 <p>For arrays of roles as parameters <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
88 class="sect">&sect;2.2.(e)</a> applies accordingly.
89 For arrays as a return value <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
90 class="sect">&sect;2.3.(d)</a> applies.
91
92 </p>
93 </div>
94 </div>
95 <table class="nav">
96 <tr>
97 <td class="back"><a href="s3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2&nbsp;Callout parameter mapping</a></td>
98 <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
99 <td class="next"><a href="s3.4.html" rel="next">&sect;3.4&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
100 </tr>
101 </table>
102 <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
103 </div>
104 <div id="footer">
Stephan Herrmann109893e2010-05-18 22:02:53 +0000105 <hr /><a class="w3c img" href="http://jigsaw.w3.org/css-validator/check/referer"
106 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"
107 width="88" /></a><address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
Stephan Herrmann8f0fa312010-06-08 18:24:55 +0000108 OT/J version 1.3 &mdash; last modified: 2010-06-08
Stephan Herrmann01664412010-04-01 20:28:43 +0000109 </div>
110 </body>
111</html>