1
0
Fork 0
cl-sites/novaspec.org/cl/f_call-next-method.html
2025-02-05 18:52:26 +01:00

505 lines
No EOL
11 KiB
HTML

<!DOCTYPE HTML>
<HTML LANG="en-us"
><HEAD
><TITLE
>call-next-method | Common Lisp Nova Spec</TITLE
><META CHARSET="US-ASCII"
><LINK REL="canonical" HREF="f_call-next-method.html"
><LINK REL="next" HREF="f_compute-applicable-methods.html" TYPE="text/html" TITLE="compute-applicable-methods"
><LINK REL="prev" HREF="f_call-method.html" TYPE="text/html" TITLE="call-method, make-method"
><LINK REL="up" HREF="7_7_Objects_Dictionary.html" TYPE="text/html" TITLE="7.7 Objects Dictionary"
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
><SCRIPT SRC="dpans.js%3F3909942064"
></SCRIPT
><SCRIPT SRC="apropos.js%3F3909942064"
></SCRIPT
></HEAD
><BODY
><DIV
><DIV CLASS="topnav"
><DIV CLASS="breadcrumb"
><SPAN CLASS="breadcrumb-item"
><A HREF="index.html"
>Common Lisp Nova Spec</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="7_Objects.html"
>7. Objects</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="7_7_Objects_Dictionary.html"
>7.7 Objects Dictionary</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="f_call-next-method.html"
>call-next-method</A
></SPAN
></DIV
><DIV CLASS="apropos"
><DIV CLASS="apropos-io"
><A HREF="f_call-method.html" CLASS="prev"
>&#8592;</A
><SPAN ID="apropos-label"
>Apropos </SPAN
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
><A HREF="f_compute-applicable-methods.html" CLASS="next"
>&#8594;</A
></DIV
><DIV ID="apropos-res"
></DIV
></DIV
></DIV
><DIV CLASS="matter"
><DIV CLASS="com"
><DIV CLASS="begincom"
><HR
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
><TR
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="call-next-method"
></SPAN
><B
>call-next-method</B
></TD
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
><I
>Local</I
> <I
>Function</I
></TD
></TR
></TABLE
><HR
></DIV
><UL CLASS="subtoc"
></UL
><DL
><DT
><B
>Syntax</B
></DT
><DD
><P CLASS="j"
><B
>call-next-method</B
> <SPAN CLASS="cmtt"
>&amp;rest</SPAN
> <SPAN CLASS="cmssi"
>args</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> {<VAR CLASS="param"
>result</VAR
>}*</P
></DD
><DT
><B
>Arguments and Values</B
></DT
><DD
><P CLASS="j"
><VAR CLASS="param"
>arg</VAR
> &#8212; an <A HREF="26_1_Glossary.html#object"
><EM CLASS="term"
>object</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>results</VAR
> &#8212; the <A HREF="26_1_Glossary.html#value"
><EM CLASS="term"
>values</EM
></A
> returned by the <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
> it calls.</P
></DD
><DT
><B
>Description</B
></DT
><DD
><P CLASS="j"
>The <A HREF="26_1_Glossary.html#function"
><EM CLASS="term"
>function</EM
></A
> <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> can be used within the body <A HREF="26_1_Glossary.html#form"
><EM CLASS="term"
>forms</EM
></A
> (but not the <A HREF="26_1_Glossary.html#lambda_list"
><EM CLASS="term"
>lambda list</EM
></A
>) of a <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
> defined by a <A HREF="26_1_Glossary.html#method-defining_form"
><EM CLASS="term"
>method-defining form</EM
></A
> to call the <A HREF="26_1_Glossary.html#next_method"
><EM CLASS="term"
>next method</EM
></A
>. </P
><P CLASS="j"
>If there is no next <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
>, the generic function <A HREF="f_no-next-method.html" CLASS="funref"
><B
>no-next-method</B
></A
> is called. </P
><P CLASS="j"
>The type of method combination used determines which <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>methods</EM
></A
> can invoke <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
>. The standard <A HREF="26_1_Glossary.html#method_combination"
><EM CLASS="term"
>method combination</EM
></A
> type allows <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> to be used within primary <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>methods</EM
></A
> and <A HREF="26_1_Glossary.html#around_method"
><EM CLASS="term"
>around methods</EM
></A
>. For generic functions using a type of method combination defined by the short form of <A HREF="f_define-method-combination.html" CLASS="macref"
><B
>define-method-combination</B
></A
>, <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> can be used in <A HREF="26_1_Glossary.html#around_method"
><EM CLASS="term"
>around methods</EM
></A
> only. </P
><P CLASS="j"
>When <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> is called with no arguments, it passes the current <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
>&#8217;s original arguments to the next <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
>. Neither argument defaulting, nor using <A HREF="f_setq.html" CLASS="specref"
><B
>setq</B
></A
>, nor rebinding variables with the same <A HREF="26_1_Glossary.html#name"
><EM CLASS="term"
>names</EM
></A
> as parameters of the <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
> affects the values <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> passes to the <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
> it calls. </P
><P CLASS="j"
>When <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> is called with arguments, the <A HREF="26_1_Glossary.html#next_method"
><EM CLASS="term"
>next method</EM
></A
> is called with those arguments. </P
><P CLASS="j"
>If <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> is called with arguments but omits optional arguments, the <A HREF="26_1_Glossary.html#next_method"
><EM CLASS="term"
>next method</EM
></A
> called defaults those arguments. </P
><P CLASS="j"
>The <A HREF="26_1_Glossary.html#function"
><EM CLASS="term"
>function</EM
></A
> <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> returns any <A HREF="26_1_Glossary.html#value"
><EM CLASS="term"
>values</EM
></A
> that are returned by the <A HREF="26_1_Glossary.html#next_method"
><EM CLASS="term"
>next method</EM
></A
>. </P
><P CLASS="j"
>The <A HREF="26_1_Glossary.html#function"
><EM CLASS="term"
>function</EM
></A
> <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> has <A HREF="26_1_Glossary.html#lexical_scope"
><EM CLASS="term"
>lexical scope</EM
></A
> and <A HREF="26_1_Glossary.html#indefinite_extent"
><EM CLASS="term"
>indefinite extent</EM
></A
> and can only be used within the body of a <A HREF="26_1_Glossary.html#method"
><EM CLASS="term"
>method</EM
></A
> defined by a <A HREF="26_1_Glossary.html#method-defining_form"
><EM CLASS="term"
>method-defining form</EM
></A
>. </P
><P CLASS="j"
>Whether or not <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> is <A HREF="26_1_Glossary.html#fbound"
><EM CLASS="term"
>fbound</EM
></A
> in the <A HREF="26_1_Glossary.html#global_environment"
><EM CLASS="term"
>global environment</EM
></A
> is <A HREF="26_1_Glossary.html#implementation-dependent"
><EM CLASS="term"
>implementation-dependent</EM
></A
>; however, the restrictions on redefinition and <A HREF="26_1_Glossary.html#shadow"
><EM CLASS="term"
>shadowing</EM
></A
> of <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> are the same as for <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbols</EM
></A
> in the <SPAN CLASS="packref"
><SPAN CLASS="cmtt"
>COMMON-LISP</SPAN
></SPAN
> <A HREF="26_1_Glossary.html#package"
><EM CLASS="term"
>package</EM
></A
> which are <A HREF="26_1_Glossary.html#fbound"
><EM CLASS="term"
>fbound</EM
></A
> in the <A HREF="26_1_Glossary.html#global_environment"
><EM CLASS="term"
>global environment</EM
></A
>. The consequences of attempting to use <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> outside of a <A HREF="26_1_Glossary.html#method-defining_form"
><EM CLASS="term"
>method-defining form</EM
></A
> are undefined.</P
></DD
><DT
><B
>Affected By</B
></DT
><DD
><P CLASS="j"
><A HREF="f_defmethod.html" CLASS="macref"
><B
>defmethod</B
></A
>, <A HREF="f_call-method.html" CLASS="macref"
><B
>call-method</B
></A
>, <A HREF="f_define-method-combination.html" CLASS="macref"
><B
>define-method-combination</B
></A
>.</P
></DD
><DT
><B
>Exceptional Situations</B
></DT
><DD
><P CLASS="j"
>When providing arguments to <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
>, the following rule must be satisfied or an error of <A HREF="26_1_Glossary.html#type"
><EM CLASS="term"
>type</EM
></A
> <A HREF="t_error.html" CLASS="typeref"
><B
>error</B
></A
> should be signaled: the ordered set of <A HREF="26_1_Glossary.html#applicable_method"
><EM CLASS="term"
>applicable methods</EM
></A
> for a changed set of arguments for <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
> must be the same as the ordered set of <A HREF="26_1_Glossary.html#applicable_method"
><EM CLASS="term"
>applicable methods</EM
></A
> for the original arguments to the <A HREF="26_1_Glossary.html#generic_function"
><EM CLASS="term"
>generic function</EM
></A
>. Optimizations of the error checking are possible, but they must not change the semantics of <A HREF="f_call-next-method.html" CLASS="funref"
><B
>call-next-method</B
></A
>.</P
></DD
><DT
><B
>See Also</B
></DT
><DD
><P CLASS="j"
><A HREF="f_define-method-combination.html" CLASS="macref"
><B
>define-method-combination</B
></A
>, <A HREF="f_defmethod.html" CLASS="macref"
><B
>defmethod</B
></A
>, <A HREF="f_next-method-p.html" CLASS="funref"
><B
>next-method-p</B
></A
>, <A HREF="f_no-next-method.html" CLASS="funref"
><B
>no-next-method</B
></A
>, <A HREF="f_call-method.html" CLASS="macref"
><B
>call-method</B
></A
>, <A HREF="7_6_Generic_Functions_and_Methods.html#sec_7_6_6" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>7.6.6</SPAN
> <SPAN CLASS="cmr"
>(Method</SPAN
> <SPAN CLASS="cmr"
>Selection</SPAN
> <SPAN CLASS="cmr"
>and</SPAN
> <SPAN CLASS="cmr"
>Combination)</SPAN
></A
>, <A HREF="7_6_Generic_Functions_and_Methods.html#sec_7_6_6_2" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>7.6.6.2</SPAN
> <SPAN CLASS="cmr"
>(Standard</SPAN
> <SPAN CLASS="cmr"
>Method</SPAN
> <SPAN CLASS="cmr"
>Combination)</SPAN
></A
>, <A HREF="7_6_Generic_Functions_and_Methods.html#sec_7_6_6_4" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>7.6.6.4</SPAN
> <SPAN CLASS="cmr"
>(Built-in</SPAN
> <SPAN CLASS="cmr"
>Method</SPAN
> <SPAN CLASS="cmr"
>Combination</SPAN
> <SPAN CLASS="cmr"
>Types)</SPAN
></A
></P
></DD
></DL
></DIV
></DIV
><DIV CLASS="footer"
><DIV CLASS="btmnav"
><A HREF="f_call-method.html" CLASS="prev"
>&#8592;</A
><A HREF="f_compute-applicable-methods.html" CLASS="next"
>&#8594;</A
></DIV
><DIV CLASS="trail"
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
></DIV
></DIV
><SCRIPT
>domReady();</SCRIPT
></BODY
></HTML
>