forked from robert-strandh/CLOS-MOP-HTML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-method.html
102 lines (83 loc) · 2.69 KB
/
add-method.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<HTML>
<HEAD>
<TITLE>add-method</TITLE>
<LINK rel="stylesheet" type="text/css" href="clos-mop.css">
</HEAD>
<BODY>
<ul class=navigation>
<a href="table-of-contents.html" title="Table of contents">
<li class=navigation><img src="toc.png" alt="TOC">
</li>
</a>
<a href="all-no-methods.html" title="Up">
<li class=navigation><img src="up.png" alt="Up">
</li>
</a>
</ul>
<A NAME="add-method"><I>Generic Function</I> <B>ADD-METHOD</B>
<P><B>Syntax:</B></P>
<P><B>add-method</B> <I>generic-function</I> <I>method</I> =>
<I>generic-function</I>
<P><B>Arguments and values:</B></P>
<P><I>generic-function</I> -- A generic function metaobject.</P>
<P><I>method</I> -- A method metaobject.</P>
<P><B>Description:</B></P>
<p>
This generic function associates an unattached method with a generic
function.
</p>
<p>
An error is signaled if the lambda list of the method is not congruent with
the lambda list of the generic function. An error is also signaled if the
method is already associated with some other generic function.
</p>
<p>
If the given method agrees with an existing method of the generic function on
parameter specializers and qualifiers, the existing method is removed by
calling
<a href="remove-method.html"><B>remove-method</B></a>
before the new method is added. See the section
of the CLOS Specification called
<a href="http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node280.html#SECTION003216300000000000000">
``Agreement on Parameter Specializers and Qualifiers'' </a>
for a definition of agreement in this context.
</p>
<p>
Associating the method with the generic function then proceeds in four steps:
<ol>
<li>add <I>method</I> to the set returned by
<a href="generic-function-methods.html">generic-function-methods</a>
arrange for
<a href="method-generic-function.html">method-generic-function</a>
to return <I>generic-function</I>;
</li>
<li>
call <a href="add-direct-method.html">add-direct-method</a> for
each of the method's specializers;
</li>
<li>
call
<a href="compute-discriminating-function.html">compute-discriminating-function</a>
and install its result with
<a href="set-funcallable-instance-function.html">set-funcallable-instance-function</a>; and
</li>
<li>
update the dependents of the generic function.
</li>
</ol>
</p>
<p>
The generic function <B>add-method</B> can be called by the user or the
implementation.
</p>
<P><B>Methods:</B></P>
<table>
<tr>
<td><a href="add-method-standard-generic-function-standard-method.html">
<B>add-method</B> (<I>generic-function</I> standard-generic-function)
(<I>method</I> standard-method)</a>
</td>
</tr>
</table>
</BODY>
</HTML>