33 lines
5.3 KiB
HTML
33 lines
5.3 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Section 7.6.6.1.2</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="07_ffaa.htm">
|
|
<LINK REL=UP HREF="07_ffa.htm">
|
|
<LINK REL=NEXT HREF="07_ffac.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="07_ffaa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="07_ffa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="07_ffac.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<H2>
|
|
7.6.6.1.2 Sorting the Applicable Methods by Precedence Order</H2> <P>
|
|
To compare the precedence of two methods, their <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> are examined in order. The default examination order is from left to right, but an alternative order may be specified by the <TT>:argument-precedence-order</TT> option to <A REL=DEFINITION HREF="m_defgen.htm#defgeneric"><B>defgeneric</B></A> or to any of the other operators that specify generic function options. <P>
|
|
The corresponding <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> from each method are compared. When a pair of <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> agree, the next pair are compared for agreement. If all corresponding parameter specializers agree, the two methods must have different <A REL=DEFINITION HREF="26_glo_q.htm#qualifier"><I>qualifiers</I></A>; in this case, either method can be selected to precede the other. For information about agreement, see <A REL=CHILD HREF="07_fc.htm">Section 7.6.3 (Agreement on Parameter Specializers and Qualifiers)</A>. <P>
|
|
If some corresponding <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> do not agree, the first pair of <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> that do not agree determines the precedence. If both <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> are classes, the more specific of the two methods is the method whose <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializer</I></A> appears earlier in the <A REL=DEFINITION HREF="26_glo_c.htm#class_precedence_list"><I>class precedence list</I></A> of the corresponding argument. Because of the way in which the set of applicable methods is chosen, the <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> are guaranteed to be present in the class precedence list of the class of the argument. <P>
|
|
If just one of a pair of corresponding <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> is <TT>(eql </TT><I>object</I><TT>)</TT>, the <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> with that <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializer</I></A> precedes the other <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A>. If both <A REL=DEFINITION HREF="26_glo_p.htm#parameter_specializer"><I>parameter specializers</I></A> are <A REL=DEFINITION HREF="f_eql.htm#eql"><B>eql</B></A> <A REL=DEFINITION HREF="26_glo_e.htm#expression"><I>expressions</I></A>, the specializers must agree (otherwise the two <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>methods</I></A> would not both have been applicable to this argument). <P>
|
|
The resulting list of <A REL=DEFINITION HREF="26_glo_a.htm#applicable_method"><I>applicable methods</I></A> has the most specific <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> first and the least specific <A REL=DEFINITION HREF="26_glo_m.htm#method"><I>method</I></A> last. <P>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|