Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 1 | <!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 Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 6 | <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"><< §3.2 Callout parameter mapping</a></td> |
| 15 | <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| 16 | <td class="next"><a href="s3.4.html" rel="next">§3.4 Overriding access restrictions >></a></td> |
| 17 | </tr> |
| 18 | </table> |
| 19 | <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">§3 Callout Binding</a></div> |
| 20 | <div class="sect depth2" id="s3.3"> |
Stephan Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 21 | <h2 class="sect">§3.3 Lifting and lowering<a class="img" href="s3.3.html" |
| 22 | title="PermaLink to §3.3 Lifting and lowering"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 23 | alt="" /></a></h2> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 24 | <p> (For basic definitions see <a href="s2.2.html" title="§2.2 Lowering" class="sect">§2.2</a> and <a href="s2.3.html" title="§2.3 Lifting" class="sect">§2.3</a>) |
| 25 | |
| 26 | </p> |
| 27 | <div class="subsect depth3" id="s3.3.a"> |
Stephan Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 28 | <h4 class="subsect">(a) <span class="title">Call target translation</span><a class="img" href="s3.3.a.html" |
| 29 | title="PermaLink to (a) Call target translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 30 | alt="" /></a></h4> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 31 | <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 Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 37 | <h4 class="subsect">(b) <span class="title">Parameter translation</span><a class="img" href="s3.3.b.html" |
| 38 | title="PermaLink to (b) Parameter translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 39 | alt="" /></a></h4> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 40 | <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 Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 48 | <h4 class="subsect">(c) <span class="title">Result translation</span><a class="img" href="s3.3.c.html" |
| 49 | title="PermaLink to (c) Result translation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 50 | alt="" /></a></h4> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 51 | <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 Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 60 | <h4 class="subsect">(d) <span class="title">Typing rules</span><a class="img" href="s3.3.d.html" title="PermaLink to (d) Typing rules"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 61 | alt="" /></a></h4> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 62 | <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 Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 85 | <h4 class="subsect">(e) <span class="title">Role arrays</span><a class="img" href="s3.3.e.html" title="PermaLink to (e) Role arrays"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| 86 | alt="" /></a></h4> |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 87 | <p>For arrays of roles as parameters <a href="s2.2.e.html" title="§2.2.(e) Lowering of arrays" |
| 88 | class="sect">§2.2.(e)</a> applies accordingly. |
| 89 | For arrays as a return value <a href="s2.3.d.html" title="§2.3.(d) Lifting of arrays" |
| 90 | class="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"><< §3.2 Callout parameter mapping</a></td> |
| 98 | <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| 99 | <td class="next"><a href="s3.4.html" rel="next">§3.4 Overriding access restrictions >></a></td> |
| 100 | </tr> |
| 101 | </table> |
| 102 | <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">§3 Callout Binding</a></div> |
| 103 | </div> |
| 104 | <div id="footer"> |
Stephan Herrmann | 109893e | 2010-05-18 22:02:53 +0000 | [diff] [blame] | 105 | <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>© Stephan Herrmann, Christine Hundt, Marco Mosconi</address> |
Stephan Herrmann | 8f0fa31 | 2010-06-08 18:24:55 +0000 | [diff] [blame^] | 108 | OT/J version 1.3 — last modified: 2010-06-08 |
Stephan Herrmann | 0166441 | 2010-04-01 20:28:43 +0000 | [diff] [blame] | 109 | </div> |
| 110 | </body> |
| 111 | </html> |