| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Method Selection and Combination (ANSI and GNU Common Lisp Document)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Method Selection and Combination (ANSI and GNU Common Lisp Document)"> |
| 9 |
<meta name="keywords" content="Method Selection and Combination (ANSI and GNU Common Lisp Document)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Generic-Functions-and-Methods.html" rel="up" title="Generic Functions and Methods"> |
| 15 |
<link href="Determining-the-Effective-Method.html" rel="next" title="Determining the Effective Method"> |
| 16 |
<link href="Examples-of-Keyword-Arguments-in-Generic-Functions-and-Methods.html" rel="prev" title="Examples of Keyword Arguments in Generic Functions and Methods"> |
| 17 |
<style type="text/css"> |
| 18 |
<!-- |
| 19 |
a.summary-letter {text-decoration: none} |
| 20 |
blockquote.indentedblock {margin-right: 0em} |
| 21 |
div.display {margin-left: 3.2em} |
| 22 |
div.example {margin-left: 3.2em} |
| 23 |
div.lisp {margin-left: 3.2em} |
| 24 |
kbd {font-style: oblique} |
| 25 |
pre.display {font-family: inherit} |
| 26 |
pre.format {font-family: inherit} |
| 27 |
pre.menu-comment {font-family: serif} |
| 28 |
pre.menu-preformatted {font-family: serif} |
| 29 |
span.nolinebreak {white-space: nowrap} |
| 30 |
span.roman {font-family: initial; font-weight: normal} |
| 31 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 32 |
ul.no-bullet {list-style: none} |
| 33 |
--> |
| 34 |
</style> |
| 35 |
|
| 36 |
|
| 37 |
</head> |
| 38 |
|
| 39 |
<body lang="en"> |
| 40 |
<span id="Method-Selection-and-Combination"></span><div class="header"> |
| 41 |
<p> |
| 42 |
Next: <a href="Inheritance-of-Methods.html" accesskey="n" rel="next">Inheritance of Methods</a>, Previous: <a href="Keyword-Arguments-in-Generic-Functions-and-Methods.html" accesskey="p" rel="prev">Keyword Arguments in Generic Functions and Methods</a>, Up: <a href="Generic-Functions-and-Methods.html" accesskey="u" rel="up">Generic Functions and Methods</a> </p> |
| 43 |
</div> |
| 44 |
<hr> |
| 45 |
<span id="Method-Selection-and-Combination-1"></span><h4 class="subsection">7.6.6 Method Selection and Combination</h4> |
| 46 |
|
| 47 |
<p>When a <i>generic function</i> is called with particular arguments, it must |
| 48 |
determine the code to execute. This code is called the |
| 49 |
<i>effective method</i> |
| 50 |
<span id="index-effective-method"></span> |
| 51 |
for those <i>arguments</i>. |
| 52 |
The <i>effective method</i> is a |
| 53 |
combination of the <i>applicable methods</i> in the <i>generic function</i> |
| 54 |
that <i>calls</i> some or all of the <i>methods</i>. |
| 55 |
</p> |
| 56 |
<p>If a <i>generic function</i> is called and no <i>methods</i> are |
| 57 |
<i>applicable</i>, the <i>generic function</i> <b>no-applicable-method</b> |
| 58 |
is invoked, with the <i>results</i> from that call being used as the |
| 59 |
<i>results</i> of the call to the original <i>generic function</i>. Calling |
| 60 |
<b>no-applicable-method</b> takes precedence over checking for acceptable |
| 61 |
keyword arguments; see <a href="Keyword-Arguments-in-Generic-Functions-and-Methods.html">Keyword Arguments in Generic Functions and Methods</a>. |
| 62 |
</p> |
| 63 |
<p>When the <i>effective method</i> has been determined, |
| 64 |
it is invoked with the same <i>arguments</i> as were passed to the <i>generic function</i>. |
| 65 |
Whatever <i>values</i> it returns are returned as the <i>values</i> |
| 66 |
of the <i>generic function</i>. |
| 67 |
</p> |
| 68 |
<table class="menu" border="0" cellspacing="0"> |
| 69 |
<tr><td align="left" valign="top">• <a href="Determining-the-Effective-Method.html" accesskey="1">Determining the Effective Method</a></td><td> </td><td align="left" valign="top"> |
| 70 |
</td></tr> |
| 71 |
<tr><td align="left" valign="top">• <a href="Selecting-the-Applicable-Methods.html" accesskey="2">Selecting the Applicable Methods</a></td><td> </td><td align="left" valign="top"> |
| 72 |
</td></tr> |
| 73 |
<tr><td align="left" valign="top">• <a href="Sorting-the-Applicable-Methods-by-Precedence-Order.html" accesskey="3">Sorting the Applicable Methods by Precedence Order</a></td><td> </td><td align="left" valign="top"> |
| 74 |
</td></tr> |
| 75 |
<tr><td align="left" valign="top">• <a href="Applying-method-combination-to-the-sorted-list-of-applicable-methods.html" accesskey="4">Applying method combination to the sorted list of applicable methods</a></td><td> </td><td align="left" valign="top"> |
| 76 |
</td></tr> |
| 77 |
<tr><td align="left" valign="top">• <a href="Standard-Method-Combination.html" accesskey="5">Standard Method Combination</a></td><td> </td><td align="left" valign="top"> |
| 78 |
</td></tr> |
| 79 |
<tr><td align="left" valign="top">• <a href="Declarative-Method-Combination.html" accesskey="6">Declarative Method Combination</a></td><td> </td><td align="left" valign="top"> |
| 80 |
</td></tr> |
| 81 |
<tr><td align="left" valign="top">• <a href="Built_002din-Method-Combination-Types.html" accesskey="7">Built-in Method Combination Types</a></td><td> </td><td align="left" valign="top"> |
| 82 |
</td></tr> |
| 83 |
</table> |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
</body> |
| 89 |
</html> |