| 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>Sorting the Applicable Methods by Precedence Order (ANSI and GNU Common Lisp Document)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Sorting the Applicable Methods by Precedence Order (ANSI and GNU Common Lisp Document)"> |
| 9 |
<meta name="keywords" content="Sorting the Applicable Methods by Precedence Order (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="Method-Selection-and-Combination.html" rel="up" title="Method Selection and Combination"> |
| 15 |
<link href="Applying-method-combination-to-the-sorted-list-of-applicable-methods.html" rel="next" title="Applying method combination to the sorted list of applicable methods"> |
| 16 |
<link href="Selecting-the-Applicable-Methods.html" rel="prev" title="Selecting the Applicable 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="Sorting-the-Applicable-Methods-by-Precedence-Order"></span><div class="header"> |
| 41 |
<p> |
| 42 |
Next: <a href="Applying-method-combination-to-the-sorted-list-of-applicable-methods.html" accesskey="n" rel="next">Applying method combination to the sorted list of applicable methods</a>, Previous: <a href="Selecting-the-Applicable-Methods.html" accesskey="p" rel="prev">Selecting the Applicable Methods</a>, Up: <a href="Method-Selection-and-Combination.html" accesskey="u" rel="up">Method Selection and Combination</a> </p> |
| 43 |
</div> |
| 44 |
<hr> |
| 45 |
<span id="Sorting-the-Applicable-Methods-by-Precedence-Order-1"></span><h4 class="subsubsection">7.6.6.3 Sorting the Applicable Methods by Precedence Order</h4> |
| 46 |
|
| 47 |
<p>To compare the precedence of two methods, their <i>parameter specializers</i> |
| 48 |
are examined in order. The default examination order is from left to |
| 49 |
right, but an alternative order may be specified by the |
| 50 |
<tt>:argument-precedence-order</tt> option to <b>defgeneric</b> or to any of |
| 51 |
the other operators that specify generic function options. |
| 52 |
</p> |
| 53 |
<p>The corresponding <i>parameter specializers</i> from each method are |
| 54 |
compared. When a pair of <i>parameter specializers</i> agree, the next |
| 55 |
pair are compared for agreement. If all corresponding parameter |
| 56 |
specializers agree, the two methods must have different |
| 57 |
<i>qualifiers</i>; in this case, either method can be selected to precede the |
| 58 |
other. For information about agreement, see <a href="Agreement-on-Parameter-Specializers-and-Qualifiers.html">Agreement on Parameter Specializers and Qualifiers</a>. |
| 59 |
</p> |
| 60 |
<p>If some corresponding <i>parameter specializers</i> do not agree, the first |
| 61 |
pair of <i>parameter specializers</i> that do not agree determines the |
| 62 |
precedence. If both <i>parameter specializers</i> are classes, the more |
| 63 |
specific of the two methods is the method whose <i>parameter specializer</i> |
| 64 |
appears earlier in the <i>class precedence list</i> of the corresponding |
| 65 |
argument. Because of the way in which the set of applicable methods |
| 66 |
is chosen, the <i>parameter specializers</i> are guaranteed to be present in |
| 67 |
the class precedence list of the class of the argument. |
| 68 |
</p> |
| 69 |
<p>If just one of a pair of corresponding <i>parameter specializers</i> is <tt>(eql <i>object</i>)</tt>, |
| 70 |
the <i>method</i> with that <i>parameter specializer</i> precedes the |
| 71 |
other <i>method</i>. If both <i>parameter specializers</i> are <b>eql</b> |
| 72 |
<i>expressions</i>, the |
| 73 |
specializers must agree (otherwise the two <i>methods</i> would |
| 74 |
not both have been applicable to this argument). |
| 75 |
</p> |
| 76 |
<p>The resulting list of <i>applicable methods</i> has the most specific |
| 77 |
<i>method</i> first and the least specific <i>method</i> last. |
| 78 |
</p> |
| 79 |
<hr> |
| 80 |
<div class="header"> |
| 81 |
<p> |
| 82 |
Next: <a href="Applying-method-combination-to-the-sorted-list-of-applicable-methods.html" accesskey="n" rel="next">Applying method combination to the sorted list of applicable methods</a>, Previous: <a href="Selecting-the-Applicable-Methods.html" accesskey="p" rel="prev">Selecting the Applicable Methods</a>, Up: <a href="Method-Selection-and-Combination.html" accesskey="u" rel="up">Method Selection and Combination</a> </p> |
| 83 |
</div> |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
</body> |
| 88 |
</html> |