Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[e90b2f]: src / doc / amop.txt Maximize Restore History

Download this file

amop.txt    269 lines (203 with data), 8.2 kB

  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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
C CLASS
SC STANDARD-CLASS
BIC BUILT-IN-CLASS
FRC FORWARD-REFERENCED-CLASS
FSC FUNCALLABLE-STANDARD-CLASS
M METHOD
SM STANDARD-METHOD
SAM STANDARD-ACCESSOR-METHOD
GF GENERIC-FUNCTION
SGF STANDARD-GENERIC-FUNCTION
SP SPECIALIZER
EQSP EQL-SPECIALIZER
SD SLOT-DEFINITION
SSD STANDARD-SLOT-DEFINITION
SDSD STANDARD-DIRECT-SLOT-DEFINITION
SESF STANDARD-EFFECTIVE-SLOT-DEFINITION
;;
;; MISCELLANEOUS PROTOCOLS
;; =======================
;;
(ADD-DEPENDENT (metaobject SC FSC SGF) dependent)
(MAP-DEPENDENT (metaobject SC FSC SGF) function)
(REMOVE-DEPENDENT (metaobject SC FSC SGF) dependent)
(UPDATE-DEPENDENT (metaobject SC FSC SGF)
(ALLOCATE-INSTANCE (class SC FSC BIC) &rest initargs)
;;
;; CLASSES
;; =======
;;
;;
;; 2.A) GENERAL CLASS ACCESSORS
;; -----------------------
(ADD-DIRECT-SUBCLASS (superclass C) (subclass C))
(REMOVE-DIRECT-SUBCLASS (superclass C) (subclass C))
(CLASS-DEFAULT-INITARGS (class C))
(CLASS-DIRECT-DEFAULT-INITARGS (class C))
(CLASS-DIRECT-SLOTS (class C))
(CLASS-DIRECT-SUBCLASSES (class C))
(CLASS-DIRECT-SUPERCLASSES (class C))
(CLASS-FINALIZED-P (class C))
(CLASS-NAME (class C))
(CLASS-PRECEDENCE-LIST (class C))
(CLASS-PROTOTYPE (class C))
(CLASS-SLOTS (class C))
[F] ((SETF CLASS-NAME) new-name class)
[F] (STANDARD-INSTANCE-ACCESS instance location)
[F] (FUNCALLABLE-STANDARD-INSTANCE-ACCESS instance location)
;;
;; 2.B) CLASS-DEFINITION
;; ----------------
[F] (ENSURE-CLASS name &key &allow-other-keys)
(ENSURE-CLASS-USING-CLASS (class (C FRC NULL)) name
&key :direct-default-initargs :direct-slots :direct-superclasses
:name (:metaclass 'STANDARD-CLASS)
&rest initargs
&allow-other-keys)
"
< CLASS is a class metaobject or NIL
< METACLASS is a class metaobject or a valid name of one (or error).
< :DIRECT-SUPERCLASSES is a proper list of class metaobjects or names (or error).
- This function may be called directly, and it is used to define or modify
the definition of a function.
- INITARGS is processed:
- The :METACLASS option is removed.
- The :DIRECT-SUPERCLASSES is processed, so that each element is
a valid class metaobject or a forward referenced class metaobject.
- The METACLASS argument is processed as follows
+ if CLASS is NIL, an instance of METACLASS is created with the
computed INITARGS.
+ if CLASS is a forward referenced class, CHANGE-CLASS is applied on
it with the value of METACLASS, and it is REINITIALIZE-CLASS with
the computed INITARGS.
+ if CLASS <> METACLASS, an error is signaled.
+ otherwise, CLASS is REINITIALIZE-CLASS with the computed INITARGS.
"
(MAKE-INSTANCE (class (SYMBOL SC FSC)) &rest initargs)
[M] (INITIALIZE-INSTANCE class &rest initargs)
[M] (REINITIALIZE-INSTANCE class &rest initargs)
[M] (SHARED-INITIALIZE class &rest initargs)
"
- Initialization is made by MAKE-INSTANCE and letting it call
INITIALIZE-INSTANCE.
- Reinitialization is made by REINITIALIZE-INSTANCE on an existing class.
- INITIALZE-INSTANCE, CHANGE-CLASS AND SHARED-INITIALIZE cannot be called
directly on a class metaobject.
- SHARED-INITIALIZE cannot be redefined by any user methods.
- [RE]INITIALIZE-INSTANCE may have extending around methods (i.e. they
must not override the existing specified methods.
< :DIRECT-DEFAULT-INITARGS is a proper list of canonicalized default initargs
(or error).
< :DIRECT-SLOTS is a proper list of canonicalized slotd definitions (or
error).
< :DIRECT-SUPERCLASSES is a proper list of valid class metaobjects (or error)
Validation is made using VALIDATE-SUPERCLASS.
< :DOCUMENTATION is either a string or NIL (or error)
< :NAME is any object
- Default values during initialization
DIRECT-DEFAULT-INITARGS => NIL
DIRECT-SLOTS => NIL
DIRECT-SUPERCLASSES => (LIST (FIND-CLASS 'STANDARD-OBJECT))
or (LIST (FIND-CLASS 'FUNCALLABLE-STANDARD-OBJECT))
DOCUMENTATION => NIL
NAME => NIL
- DIRECT-SLOTS is converted to a list of slot definition objects
+ DIRECT-SLOT-DEFINITION-CLASS provides the class
+ MAKE-INSTANCE is used to create the slot definition
+ After slots are created, reader and writer methods are created
using READER-METHOD-CLASS and WRITER-METHOD-CLASS.
"
(COMPUTE-CLASS-PRECEDENCE-LIST (class C))
(COMPUTE-DEFAULT-INITARGS (class (SC FSC))
(VALIDATE-SUPERCLASS (class C) (superclass C))
(FINALIZE-INHERITANCE (class (SC FSC FRC)))
"
- This function is called with a class, at least before the first
invocation of ALLOCATE-INSTANCE.
- COMPUTE-CLASS-PRECEDENCE-LIST is done, and the value stored.
- COMPUTE-SLOTS is done and the value stored. It involves calling
- EFFECTIVE-SLOT-DEFINITION-CLASS
- COMPUTE-EFFECTIVE-SLOT-DEFINITION
- COMPUTE-DEFAULT-INITARGS is done and the value stored.
- If the class was previously finalized, and the local slots have
changed MAKE-INSTANCES-OBSOLETE is invoked.
- FINALIZE-INHERITANCE signals an error with forward referenced classes.
"
;;
;; 2.C) SLOT ALLOCATION AND DEFINITION
;; ------------------------------
(COMPUTE-EFFECTIVE-SLOT-DEFINITION (class (SC FSC)) name direct-slot-definitions)
(COMPUTE-SLOTS (class (SC FSC)))
(COMPUTE-SLOTS :AROUND (class (SC FSC)))
(DIRECT-SLOT-DEFINITION-CLASS (class (SC FSC)) &rest initargs)
(EFFECTIVE-SLOT-DEFINITION-CLASS (class (SC FSC)) &rest initargs)
;;
;; 2.D) SLOT ACCESSING
;; --------------
;;
((SETF SLOT-VALUE-USING-CLASS) new-value (class (SC FSC BIC)) object (slot SESD))
(SLOT-BOUNDP-USING-CLASS) (class SC FSC BIC) object (slot SESD))
(SLOT-MAKUNBOUND-USING-CLASS) (class SC FSC BIC) object (slot SESD))
(SLOT-VALUE-USING-CLASS (class SC FSC BIC) object (slot SESD))
;;
;; SLOTS
;; =====
;;
(SLOT-DEFINITION-ALLOCATION (slotd SSD))
(SLOT-DEFINITION-INITARGS (slotd SSD))
(SLOT-DEFINITION-INITFORM (slotd SSD))
(SLOT-DEFINITION-INITFUNCTION (slotd SSD))
(SLOT-DEFINITION-NAME (slotd SSD))
(SLOT-DEFINITION-TYPE (slotd SSD))
(SLOT-DEFINITION-READERS (direct-slot SDSD))
(SLOT-DEFINITION-WRITERS (direct-slot SDSD))
(SLOT-DEFINITION-LOCATION (effective-slot SESD))
;;
;; SPECIALIZERS
;; ============
;;
(ADD-DIRECT-METHOD (specializer C EQSP) (method M))
(REMOVE-DIRECT-METHOD (specializer C EQSP) (method M))
[F] (EQL-SPECIALIZER-OBJECT eql-specializer)
(SPECIALIZER-DIRECT-GENERIC-FUNCTIONS (specializer C EQSP))
(SPECIALIZER-DIRECT-METHODS (specializer C EQSP))
;;
;; GENERIC FUNCTIONS
;; =================
;;
(ADD-METHOD (gf SGF) (method SM))
(COMPUTE-APPLICABLE-METHODS (gf SGF) arguments)
(COMPUTE-APPLICABLE-METHODS-USING-CLASSES (gf SGF) classes)
(COMPUTE-DISCRIMINATING-FUNCTION (gf SGF))
(COMPUTE-EFFECTIVE-METHOD (gf SGF) method-combination methods)
[F] (ENSURE-GENERIC-FUNCTION function-name &key &alow-other-keys)
(ENSURE-GENERIC-FUNCTION-USING-CLASS (gf (GF NULL)) function-name
&key :argument-precedence-order :declarations :documentation
:generic-function-class :lambda-list :method-class
:method-combination :name
&alow-other-keys)
[F] (EXTRACT-LAMBDA-LIST specialized-lambda-list)
[F] (EXTRACT-SPECIALIZER-NAMES specialized-lambda-list)
(FIND-METHOD-COMBINATION gf method-combination-type-name method-combination-options)
[F] (FUNCALLABLE-STANDARD-INSTANCE-ACCESS instance location)
(GENERIC-FUNCTION-ARGUMENT-PRECEDENCE-ORDER (gf SGF))
(GENERIC-FUNCTION-DECLARATIONS (gf SGF))
(GENERIC-FUNCTION-LAMBDA-LIST (gf SGF))
(GENERIC-FUNCTION-METHOD-CLASS (gf SGF))
(GENERIC-FUNCTION-METHOD-COMBINATION (gf SGF))
(GENERIC-FUNCTION-METHODS (gf SGF))
(GENERIC-FUNCTION-NAME (gf SGF))
[F] (INTERN-EQL-SPECIALIZER object)
(MAKE-METHOD-LAMBDA (gf SGF) (method SM) lambda-expression environment)
(MAP-DEPENDENT (metaobject (SC FSC SGF)) function)
(METHOD-FUNCTION (method SM))
(METHOD-GENERIC-FUNCTION (method SM))
(METHOD-LAMBDA-LIST (method SM))
(METHOD-SPECIALIZERS (method SM))
(METHOD-QUALIFIERS (method SM))
(ACCESSOR-METHOD-SLOT-DEFINITION (method SAM))
(READER-METHOD-CLASS (class (SC FSC)) (direct-slot SDSD) &rest initargs)
(REMOVE-METHOD (gf SGF) (method SM))
[F] (SET-FUNCALLABLE-INSTANCE-FUNCTION funcallable-instance function)
[F] ((SETF GENERIC-FUNCTION-NAME) new-name gf)
(WRITER-METHOD-CLASS (class SC) (direct-slot SDSD) &rest initargs)