1 | /* |
---|
2 | * StandardClass.java |
---|
3 | * |
---|
4 | * Copyright (C) 2003-2005 Peter Graves |
---|
5 | * $Id: StandardClass.java 14083 2012-08-14 11:53:16Z rschlatte $ |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or |
---|
8 | * modify it under the terms of the GNU General Public License |
---|
9 | * as published by the Free Software Foundation; either version 2 |
---|
10 | * of the License, or (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
20 | * |
---|
21 | * As a special exception, the copyright holders of this library give you |
---|
22 | * permission to link this library with independent modules to produce an |
---|
23 | * executable, regardless of the license terms of these independent |
---|
24 | * modules, and to copy and distribute the resulting executable under |
---|
25 | * terms of your choice, provided that you also meet, for each linked |
---|
26 | * independent module, the terms and conditions of the license of that |
---|
27 | * module. An independent module is a module which is not derived from |
---|
28 | * or based on this library. If you modify this library, you may extend |
---|
29 | * this exception to your version of the library, but you are not |
---|
30 | * obligated to do so. If you do not wish to do so, delete this |
---|
31 | * exception statement from your version. |
---|
32 | */ |
---|
33 | |
---|
34 | package org.armedbear.lisp; |
---|
35 | |
---|
36 | import static org.armedbear.lisp.Lisp.*; |
---|
37 | |
---|
38 | public class StandardClass extends SlotClass |
---|
39 | { |
---|
40 | |
---|
41 | public static Symbol symName = PACKAGE_MOP.intern("NAME"); |
---|
42 | public static Symbol symLayout = PACKAGE_MOP.intern("LAYOUT"); |
---|
43 | public static Symbol symDirectSuperclasses |
---|
44 | = PACKAGE_MOP.intern("DIRECT-SUPERCLASSES"); |
---|
45 | public static Symbol symDirectSubclasses |
---|
46 | = PACKAGE_MOP.intern("DIRECT-SUBCLASSES"); |
---|
47 | public static Symbol symPrecedenceList |
---|
48 | = PACKAGE_MOP.intern("PRECEDENCE-LIST"); |
---|
49 | public static Symbol symDirectMethods |
---|
50 | = PACKAGE_MOP.intern("DIRECT-METHODS"); |
---|
51 | public static Symbol symDirectSlots |
---|
52 | = PACKAGE_MOP.intern("DIRECT-SLOTS"); |
---|
53 | public static Symbol symSlots |
---|
54 | = PACKAGE_MOP.intern("SLOTS"); |
---|
55 | public static Symbol symDirectDefaultInitargs |
---|
56 | = PACKAGE_MOP.intern("DIRECT-DEFAULT-INITARGS"); |
---|
57 | public static Symbol symDefaultInitargs |
---|
58 | = PACKAGE_MOP.intern("DEFAULT-INITARGS"); |
---|
59 | public static Symbol symFinalizedP |
---|
60 | = PACKAGE_MOP.intern("FINALIZED-P"); |
---|
61 | |
---|
62 | // used as init-function for slots in this file. |
---|
63 | static Function constantlyNil = new Function() { |
---|
64 | @Override |
---|
65 | public LispObject execute() |
---|
66 | { |
---|
67 | return NIL; |
---|
68 | } |
---|
69 | }; |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | static Layout layoutStandardClass = |
---|
74 | new Layout(null, |
---|
75 | list(symName, |
---|
76 | symLayout, |
---|
77 | symDirectSuperclasses, |
---|
78 | symDirectSubclasses, |
---|
79 | symPrecedenceList, |
---|
80 | symDirectMethods, |
---|
81 | symDirectSlots, |
---|
82 | symSlots, |
---|
83 | symDirectDefaultInitargs, |
---|
84 | symDefaultInitargs, |
---|
85 | symFinalizedP, |
---|
86 | Symbol._DOCUMENTATION), |
---|
87 | NIL) |
---|
88 | { |
---|
89 | @Override |
---|
90 | public LispClass getLispClass() |
---|
91 | { |
---|
92 | return STANDARD_CLASS; |
---|
93 | } |
---|
94 | }; |
---|
95 | |
---|
96 | static Layout layoutFuncallableStandardClass = |
---|
97 | new Layout(null, |
---|
98 | list(symName, |
---|
99 | symLayout, |
---|
100 | symDirectSuperclasses, |
---|
101 | symDirectSubclasses, |
---|
102 | symPrecedenceList, |
---|
103 | symDirectMethods, |
---|
104 | symDirectSlots, |
---|
105 | symSlots, |
---|
106 | symDirectDefaultInitargs, |
---|
107 | symDefaultInitargs, |
---|
108 | symFinalizedP, |
---|
109 | Symbol._DOCUMENTATION), |
---|
110 | NIL) |
---|
111 | { |
---|
112 | @Override |
---|
113 | public LispClass getLispClass() |
---|
114 | { |
---|
115 | return FUNCALLABLE_STANDARD_CLASS; |
---|
116 | } |
---|
117 | }; |
---|
118 | |
---|
119 | |
---|
120 | |
---|
121 | public StandardClass() |
---|
122 | { |
---|
123 | super(layoutStandardClass); |
---|
124 | setDirectSuperclasses(NIL); |
---|
125 | setDirectSubclasses(NIL); |
---|
126 | setClassLayout(layoutStandardClass); |
---|
127 | setCPL(NIL); |
---|
128 | setDirectMethods(NIL); |
---|
129 | setDocumentation(NIL); |
---|
130 | setDirectSlotDefinitions(NIL); |
---|
131 | setSlotDefinitions(NIL); |
---|
132 | setDirectDefaultInitargs(NIL); |
---|
133 | setDefaultInitargs(NIL); |
---|
134 | setFinalized(false); |
---|
135 | } |
---|
136 | |
---|
137 | public StandardClass(Symbol symbol, LispObject directSuperclasses) |
---|
138 | { |
---|
139 | super(layoutStandardClass, |
---|
140 | symbol, directSuperclasses); |
---|
141 | setDirectSubclasses(NIL); |
---|
142 | setClassLayout(layoutStandardClass); |
---|
143 | setCPL(NIL); |
---|
144 | setDirectMethods(NIL); |
---|
145 | setDocumentation(NIL); |
---|
146 | setDirectSlotDefinitions(NIL); |
---|
147 | setSlotDefinitions(NIL); |
---|
148 | setDirectDefaultInitargs(NIL); |
---|
149 | setDefaultInitargs(NIL); |
---|
150 | setFinalized(false); |
---|
151 | } |
---|
152 | |
---|
153 | public StandardClass(Layout layout) |
---|
154 | { |
---|
155 | super(layout); |
---|
156 | setDirectSuperclasses(NIL); |
---|
157 | setDirectSubclasses(NIL); |
---|
158 | setClassLayout(layout); |
---|
159 | setCPL(NIL); |
---|
160 | setDirectMethods(NIL); |
---|
161 | setDocumentation(NIL); |
---|
162 | setDirectSlotDefinitions(NIL); |
---|
163 | setSlotDefinitions(NIL); |
---|
164 | setDirectDefaultInitargs(NIL); |
---|
165 | setDefaultInitargs(NIL); |
---|
166 | setFinalized(false); |
---|
167 | } |
---|
168 | |
---|
169 | public StandardClass(Layout layout, Symbol symbol, LispObject directSuperclasses) |
---|
170 | { |
---|
171 | super(layout, symbol, directSuperclasses); |
---|
172 | setDirectSubclasses(NIL); |
---|
173 | setClassLayout(layout); |
---|
174 | setCPL(NIL); |
---|
175 | setDirectMethods(NIL); |
---|
176 | setDocumentation(NIL); |
---|
177 | setDirectSlotDefinitions(NIL); |
---|
178 | setSlotDefinitions(NIL); |
---|
179 | setDirectDefaultInitargs(NIL); |
---|
180 | setDefaultInitargs(NIL); |
---|
181 | setFinalized(false); |
---|
182 | |
---|
183 | } |
---|
184 | |
---|
185 | @Override |
---|
186 | public LispObject getName() |
---|
187 | { |
---|
188 | return getInstanceSlotValue(symName); |
---|
189 | } |
---|
190 | |
---|
191 | @Override |
---|
192 | public void setName(LispObject newName) |
---|
193 | { |
---|
194 | setInstanceSlotValue(symName, newName); |
---|
195 | } |
---|
196 | |
---|
197 | @Override |
---|
198 | public Layout getClassLayout() |
---|
199 | { |
---|
200 | LispObject layout = getInstanceSlotValue(symLayout); |
---|
201 | if (layout == UNBOUND_VALUE) |
---|
202 | return null; |
---|
203 | |
---|
204 | if (! (layout instanceof Layout)) { |
---|
205 | // (new Error()).printStackTrace(); |
---|
206 | // LispThread.currentThread().printBacktrace(); |
---|
207 | // System.err.println("Class: " + this.princToString()); |
---|
208 | return (Layout)Lisp.error(Symbol.TYPE_ERROR, |
---|
209 | new SimpleString("The value " + layout.princToString() |
---|
210 | + " is not of expected type " |
---|
211 | + Symbol.LAYOUT.princToString() |
---|
212 | + " in class " + this.princToString() + ".")); |
---|
213 | } |
---|
214 | |
---|
215 | return (layout == UNBOUND_VALUE) ? null : (Layout)layout; |
---|
216 | } |
---|
217 | |
---|
218 | @Override |
---|
219 | public void setClassLayout(LispObject newLayout) |
---|
220 | { |
---|
221 | setInstanceSlotValue(symLayout, newLayout); |
---|
222 | } |
---|
223 | |
---|
224 | @Override |
---|
225 | public LispObject getDirectSuperclasses() |
---|
226 | { |
---|
227 | return getInstanceSlotValue(symDirectSuperclasses); |
---|
228 | } |
---|
229 | |
---|
230 | @Override |
---|
231 | public void setDirectSuperclasses(LispObject directSuperclasses) |
---|
232 | { |
---|
233 | setInstanceSlotValue(symDirectSuperclasses, directSuperclasses); |
---|
234 | } |
---|
235 | |
---|
236 | @Override |
---|
237 | public final boolean isFinalized() |
---|
238 | { |
---|
239 | return getInstanceSlotValue(symFinalizedP) != NIL; |
---|
240 | } |
---|
241 | |
---|
242 | @Override |
---|
243 | public final void setFinalized(boolean b) |
---|
244 | { |
---|
245 | setInstanceSlotValue(symFinalizedP, b ? T : NIL); |
---|
246 | } |
---|
247 | |
---|
248 | @Override |
---|
249 | public LispObject getDirectSubclasses() |
---|
250 | { |
---|
251 | return getInstanceSlotValue(symDirectSubclasses); |
---|
252 | } |
---|
253 | |
---|
254 | @Override |
---|
255 | public void setDirectSubclasses(LispObject directSubclasses) |
---|
256 | { |
---|
257 | setInstanceSlotValue(symDirectSubclasses, directSubclasses); |
---|
258 | } |
---|
259 | |
---|
260 | @Override |
---|
261 | public LispObject getCPL() |
---|
262 | { |
---|
263 | return getInstanceSlotValue(symPrecedenceList); |
---|
264 | } |
---|
265 | |
---|
266 | @Override |
---|
267 | public void setCPL(LispObject... cpl) |
---|
268 | { |
---|
269 | LispObject obj1 = cpl[0]; |
---|
270 | if (obj1.listp() && cpl.length == 1) |
---|
271 | setInstanceSlotValue(symPrecedenceList, obj1); |
---|
272 | else |
---|
273 | { |
---|
274 | Debug.assertTrue(obj1 == this); |
---|
275 | LispObject l = NIL; |
---|
276 | for (int i = cpl.length; i-- > 0;) |
---|
277 | l = new Cons(cpl[i], l); |
---|
278 | setInstanceSlotValue(symPrecedenceList, l); |
---|
279 | } |
---|
280 | } |
---|
281 | |
---|
282 | @Override |
---|
283 | public LispObject getDirectMethods() |
---|
284 | { |
---|
285 | return getInstanceSlotValue(symDirectMethods); |
---|
286 | } |
---|
287 | |
---|
288 | @Override |
---|
289 | public void setDirectMethods(LispObject methods) |
---|
290 | { |
---|
291 | setInstanceSlotValue(symDirectMethods, methods); |
---|
292 | } |
---|
293 | |
---|
294 | @Override |
---|
295 | public LispObject getDocumentation() |
---|
296 | { |
---|
297 | return getInstanceSlotValue(Symbol._DOCUMENTATION); |
---|
298 | } |
---|
299 | |
---|
300 | @Override |
---|
301 | public void setDocumentation(LispObject doc) |
---|
302 | { |
---|
303 | setInstanceSlotValue(Symbol._DOCUMENTATION, doc); |
---|
304 | } |
---|
305 | |
---|
306 | @Override |
---|
307 | public LispObject getDirectSlotDefinitions() |
---|
308 | { |
---|
309 | return getInstanceSlotValue(symDirectSlots); |
---|
310 | } |
---|
311 | |
---|
312 | @Override |
---|
313 | public void setDirectSlotDefinitions(LispObject directSlotDefinitions) |
---|
314 | { |
---|
315 | setInstanceSlotValue(symDirectSlots, directSlotDefinitions); |
---|
316 | } |
---|
317 | |
---|
318 | @Override |
---|
319 | public LispObject getSlotDefinitions() |
---|
320 | { |
---|
321 | return getInstanceSlotValue(symSlots); |
---|
322 | } |
---|
323 | |
---|
324 | @Override |
---|
325 | public void setSlotDefinitions(LispObject slotDefinitions) |
---|
326 | { |
---|
327 | setInstanceSlotValue(symSlots, slotDefinitions); |
---|
328 | } |
---|
329 | |
---|
330 | @Override |
---|
331 | public LispObject getDirectDefaultInitargs() |
---|
332 | { |
---|
333 | return getInstanceSlotValue(symDirectDefaultInitargs); |
---|
334 | } |
---|
335 | |
---|
336 | @Override |
---|
337 | public void setDirectDefaultInitargs(LispObject directDefaultInitargs) |
---|
338 | { |
---|
339 | setInstanceSlotValue(symDirectDefaultInitargs, directDefaultInitargs); |
---|
340 | } |
---|
341 | |
---|
342 | @Override |
---|
343 | public LispObject getDefaultInitargs() |
---|
344 | { |
---|
345 | return getInstanceSlotValue(symDefaultInitargs); |
---|
346 | } |
---|
347 | |
---|
348 | @Override |
---|
349 | public void setDefaultInitargs(LispObject defaultInitargs) |
---|
350 | { |
---|
351 | setInstanceSlotValue(symDefaultInitargs, defaultInitargs); |
---|
352 | } |
---|
353 | |
---|
354 | @Override |
---|
355 | public LispObject typeOf() |
---|
356 | { |
---|
357 | return Symbol.STANDARD_CLASS; |
---|
358 | } |
---|
359 | |
---|
360 | @Override |
---|
361 | public LispObject classOf() |
---|
362 | { |
---|
363 | return STANDARD_CLASS; |
---|
364 | } |
---|
365 | |
---|
366 | @Override |
---|
367 | public LispObject typep(LispObject type) |
---|
368 | { |
---|
369 | if (type == Symbol.STANDARD_CLASS) |
---|
370 | return T; |
---|
371 | if (type == STANDARD_CLASS) |
---|
372 | return T; |
---|
373 | return super.typep(type); |
---|
374 | } |
---|
375 | |
---|
376 | public LispObject allocateInstance() |
---|
377 | { |
---|
378 | Layout layout = getClassLayout(); |
---|
379 | if (layout == null) |
---|
380 | { |
---|
381 | Symbol.ERROR.execute(Symbol.SIMPLE_ERROR, |
---|
382 | Keyword.FORMAT_CONTROL, |
---|
383 | new SimpleString("No layout for class ~S."), |
---|
384 | Keyword.FORMAT_ARGUMENTS, |
---|
385 | list(this)); |
---|
386 | } |
---|
387 | return new StandardObject(this, layout.getLength()); |
---|
388 | } |
---|
389 | |
---|
390 | @Override |
---|
391 | public String printObject() |
---|
392 | { |
---|
393 | StringBuilder sb = |
---|
394 | new StringBuilder(Symbol.STANDARD_CLASS.printObject()); |
---|
395 | if (getName() != null) |
---|
396 | { |
---|
397 | sb.append(' '); |
---|
398 | sb.append(getName().printObject()); |
---|
399 | } |
---|
400 | return unreadableString(sb.toString()); |
---|
401 | } |
---|
402 | |
---|
403 | private static final LispObject standardClassSlotDefinitions() |
---|
404 | { |
---|
405 | return |
---|
406 | list(helperMakeSlotDefinition("NAME", constantlyNil), |
---|
407 | helperMakeSlotDefinition("LAYOUT", constantlyNil), |
---|
408 | helperMakeSlotDefinition("DIRECT-SUPERCLASSES", constantlyNil), |
---|
409 | helperMakeSlotDefinition("DIRECT-SUBCLASSES", constantlyNil), |
---|
410 | helperMakeSlotDefinition("PRECEDENCE-LIST", constantlyNil), |
---|
411 | helperMakeSlotDefinition("DIRECT-METHODS", constantlyNil), |
---|
412 | helperMakeSlotDefinition("DIRECT-SLOTS", constantlyNil), |
---|
413 | helperMakeSlotDefinition("SLOTS", constantlyNil), |
---|
414 | helperMakeSlotDefinition("DIRECT-DEFAULT-INITARGS", constantlyNil), |
---|
415 | helperMakeSlotDefinition("DEFAULT-INITARGS", constantlyNil), |
---|
416 | helperMakeSlotDefinition("FINALIZED-P", constantlyNil), |
---|
417 | new SlotDefinition(Symbol._DOCUMENTATION, |
---|
418 | list(PACKAGE_MOP.intern("CLASS-DOCUMENTATION")), |
---|
419 | constantlyNil, list(internKeyword("DOCUMENTATION")))); |
---|
420 | } |
---|
421 | |
---|
422 | |
---|
423 | |
---|
424 | private static final SlotDefinition helperMakeSlotDefinition(String name, |
---|
425 | Function init) |
---|
426 | { |
---|
427 | return |
---|
428 | new SlotDefinition(PACKAGE_MOP.intern(name), // name |
---|
429 | list(PACKAGE_MOP.intern("CLASS-" + name)), // readers |
---|
430 | init); |
---|
431 | } |
---|
432 | |
---|
433 | private static final StandardClass addStandardClass(Symbol name, |
---|
434 | LispObject directSuperclasses) |
---|
435 | { |
---|
436 | StandardClass c = new StandardClass(name, directSuperclasses); |
---|
437 | addClass(name, c); |
---|
438 | return c; |
---|
439 | } |
---|
440 | |
---|
441 | // At this point, BuiltInClass.java has not been completely loaded yet, and |
---|
442 | // BuiltInClass.CLASS_T is null. So we need to call setDirectSuperclass() |
---|
443 | // for STANDARD_CLASS and STANDARD_OBJECT in initializeStandardClasses() |
---|
444 | // below. |
---|
445 | public static final StandardClass STANDARD_CLASS = |
---|
446 | addStandardClass(Symbol.STANDARD_CLASS, list(BuiltInClass.CLASS_T)); |
---|
447 | public static final StandardClass STANDARD_OBJECT = |
---|
448 | addStandardClass(Symbol.STANDARD_OBJECT, list(BuiltInClass.CLASS_T)); |
---|
449 | public static final StandardClass METAOBJECT = |
---|
450 | addStandardClass(Symbol.METAOBJECT, list(STANDARD_OBJECT)); |
---|
451 | public static final StandardClass SPECIALIZER = |
---|
452 | addStandardClass(Symbol.SPECIALIZER, list(METAOBJECT)); |
---|
453 | |
---|
454 | public static final StandardClass SLOT_DEFINITION = |
---|
455 | addStandardClass(Symbol.SLOT_DEFINITION, list(METAOBJECT)); |
---|
456 | public static final StandardClass STANDARD_SLOT_DEFINITION = |
---|
457 | addClass(Symbol.STANDARD_SLOT_DEFINITION, new SlotDefinitionClass(Symbol.STANDARD_SLOT_DEFINITION, list(SLOT_DEFINITION))); |
---|
458 | |
---|
459 | static |
---|
460 | { |
---|
461 | SLOT_DEFINITION.finalizeClass(); |
---|
462 | |
---|
463 | STANDARD_CLASS.setClassLayout(layoutStandardClass); |
---|
464 | STANDARD_CLASS.setDirectSlotDefinitions(standardClassSlotDefinitions()); |
---|
465 | } |
---|
466 | |
---|
467 | public static final StandardClass DIRECT_SLOT_DEFINITION = |
---|
468 | addStandardClass(Symbol.DIRECT_SLOT_DEFINITION, list(SLOT_DEFINITION)); |
---|
469 | public static final StandardClass EFFECTIVE_SLOT_DEFINITION = |
---|
470 | addStandardClass(Symbol.EFFECTIVE_SLOT_DEFINITION, list(SLOT_DEFINITION)); |
---|
471 | // addStandardClass(Symbol.STANDARD_SLOT_DEFINITION, list(SLOT_DEFINITION)); |
---|
472 | public static final StandardClass STANDARD_DIRECT_SLOT_DEFINITION = |
---|
473 | addClass(Symbol.STANDARD_DIRECT_SLOT_DEFINITION, |
---|
474 | new SlotDefinitionClass(Symbol.STANDARD_DIRECT_SLOT_DEFINITION, |
---|
475 | list(STANDARD_SLOT_DEFINITION, DIRECT_SLOT_DEFINITION))); |
---|
476 | public static final StandardClass STANDARD_EFFECTIVE_SLOT_DEFINITION = |
---|
477 | addClass(Symbol.STANDARD_EFFECTIVE_SLOT_DEFINITION, |
---|
478 | new SlotDefinitionClass(Symbol.STANDARD_EFFECTIVE_SLOT_DEFINITION, |
---|
479 | list(STANDARD_SLOT_DEFINITION, EFFECTIVE_SLOT_DEFINITION))); |
---|
480 | |
---|
481 | |
---|
482 | // BuiltInClass.FUNCTION is also null here (see previous comment). |
---|
483 | public static final StandardClass FUNCALLABLE_STANDARD_OBJECT = |
---|
484 | addStandardClass(Symbol.FUNCALLABLE_STANDARD_OBJECT, |
---|
485 | list(STANDARD_OBJECT, BuiltInClass.FUNCTION)); |
---|
486 | |
---|
487 | public static final StandardClass GENERIC_FUNCTION = |
---|
488 | new FuncallableStandardClass(Symbol.GENERIC_FUNCTION, |
---|
489 | list(METAOBJECT, FUNCALLABLE_STANDARD_OBJECT)); |
---|
490 | static { |
---|
491 | addClass(Symbol.GENERIC_FUNCTION, GENERIC_FUNCTION); |
---|
492 | } |
---|
493 | |
---|
494 | public static final StandardClass CLASS = |
---|
495 | addStandardClass(Symbol.CLASS, list(SPECIALIZER)); |
---|
496 | |
---|
497 | public static final StandardClass BUILT_IN_CLASS = |
---|
498 | addStandardClass(Symbol.BUILT_IN_CLASS, list(CLASS)); |
---|
499 | |
---|
500 | public static final StandardClass FORWARD_REFERENCED_CLASS = |
---|
501 | addStandardClass(Symbol.FORWARD_REFERENCED_CLASS, list(CLASS)); |
---|
502 | |
---|
503 | public static final StandardClass STRUCTURE_CLASS = |
---|
504 | addStandardClass(Symbol.STRUCTURE_CLASS, list(CLASS)); |
---|
505 | |
---|
506 | public static final StandardClass FUNCALLABLE_STANDARD_CLASS = |
---|
507 | addStandardClass(Symbol.FUNCALLABLE_STANDARD_CLASS, list(CLASS)); |
---|
508 | |
---|
509 | public static final StandardClass CONDITION = |
---|
510 | addStandardClass(Symbol.CONDITION, list(STANDARD_OBJECT)); |
---|
511 | |
---|
512 | public static final StandardClass SIMPLE_CONDITION = |
---|
513 | addStandardClass(Symbol.SIMPLE_CONDITION, list(CONDITION)); |
---|
514 | |
---|
515 | public static final StandardClass WARNING = |
---|
516 | addStandardClass(Symbol.WARNING, list(CONDITION)); |
---|
517 | |
---|
518 | public static final StandardClass SIMPLE_WARNING = |
---|
519 | addStandardClass(Symbol.SIMPLE_WARNING, list(SIMPLE_CONDITION, WARNING)); |
---|
520 | |
---|
521 | public static final StandardClass STYLE_WARNING = |
---|
522 | addStandardClass(Symbol.STYLE_WARNING, list(WARNING)); |
---|
523 | |
---|
524 | public static final StandardClass SERIOUS_CONDITION = |
---|
525 | addStandardClass(Symbol.SERIOUS_CONDITION, list(CONDITION)); |
---|
526 | |
---|
527 | public static final StandardClass STORAGE_CONDITION = |
---|
528 | addStandardClass(Symbol.STORAGE_CONDITION, list(SERIOUS_CONDITION)); |
---|
529 | |
---|
530 | public static final StandardClass ERROR = |
---|
531 | addStandardClass(Symbol.ERROR, list(SERIOUS_CONDITION)); |
---|
532 | |
---|
533 | public static final StandardClass ARITHMETIC_ERROR = |
---|
534 | addStandardClass(Symbol.ARITHMETIC_ERROR, list(ERROR)); |
---|
535 | |
---|
536 | public static final StandardClass CELL_ERROR = |
---|
537 | addStandardClass(Symbol.CELL_ERROR, list(ERROR)); |
---|
538 | |
---|
539 | public static final StandardClass CONTROL_ERROR = |
---|
540 | addStandardClass(Symbol.CONTROL_ERROR, list(ERROR)); |
---|
541 | |
---|
542 | public static final StandardClass FILE_ERROR = |
---|
543 | addStandardClass(Symbol.FILE_ERROR, list(ERROR)); |
---|
544 | |
---|
545 | public static final StandardClass DIVISION_BY_ZERO = |
---|
546 | addStandardClass(Symbol.DIVISION_BY_ZERO, list(ARITHMETIC_ERROR)); |
---|
547 | |
---|
548 | public static final StandardClass FLOATING_POINT_INEXACT = |
---|
549 | addStandardClass(Symbol.FLOATING_POINT_INEXACT, list(ARITHMETIC_ERROR)); |
---|
550 | |
---|
551 | public static final StandardClass FLOATING_POINT_INVALID_OPERATION = |
---|
552 | addStandardClass(Symbol.FLOATING_POINT_INVALID_OPERATION, list(ARITHMETIC_ERROR)); |
---|
553 | |
---|
554 | public static final StandardClass FLOATING_POINT_OVERFLOW = |
---|
555 | addStandardClass(Symbol.FLOATING_POINT_OVERFLOW, list(ARITHMETIC_ERROR)); |
---|
556 | |
---|
557 | public static final StandardClass FLOATING_POINT_UNDERFLOW = |
---|
558 | addStandardClass(Symbol.FLOATING_POINT_UNDERFLOW, list(ARITHMETIC_ERROR)); |
---|
559 | |
---|
560 | public static final StandardClass PROGRAM_ERROR = |
---|
561 | addStandardClass(Symbol.PROGRAM_ERROR, list(ERROR)); |
---|
562 | |
---|
563 | public static final StandardClass PACKAGE_ERROR = |
---|
564 | addStandardClass(Symbol.PACKAGE_ERROR, list(ERROR)); |
---|
565 | |
---|
566 | public static final StandardClass STREAM_ERROR = |
---|
567 | addStandardClass(Symbol.STREAM_ERROR, list(ERROR)); |
---|
568 | |
---|
569 | public static final StandardClass PARSE_ERROR = |
---|
570 | addStandardClass(Symbol.PARSE_ERROR, list(ERROR)); |
---|
571 | |
---|
572 | public static final StandardClass PRINT_NOT_READABLE = |
---|
573 | addStandardClass(Symbol.PRINT_NOT_READABLE, list(ERROR)); |
---|
574 | |
---|
575 | public static final StandardClass READER_ERROR = |
---|
576 | addStandardClass(Symbol.READER_ERROR, list(PARSE_ERROR, STREAM_ERROR)); |
---|
577 | |
---|
578 | public static final StandardClass END_OF_FILE = |
---|
579 | addStandardClass(Symbol.END_OF_FILE, list(STREAM_ERROR)); |
---|
580 | |
---|
581 | public static final StandardClass SIMPLE_ERROR = |
---|
582 | addStandardClass(Symbol.SIMPLE_ERROR, list(SIMPLE_CONDITION, ERROR)); |
---|
583 | |
---|
584 | public static final StandardClass TYPE_ERROR = |
---|
585 | addStandardClass(Symbol.TYPE_ERROR, list(ERROR)); |
---|
586 | |
---|
587 | public static final StandardClass SIMPLE_TYPE_ERROR = |
---|
588 | addStandardClass(Symbol.SIMPLE_TYPE_ERROR, list(SIMPLE_CONDITION, |
---|
589 | TYPE_ERROR)); |
---|
590 | |
---|
591 | public static final StandardClass UNBOUND_SLOT = |
---|
592 | addStandardClass(Symbol.UNBOUND_SLOT, list(CELL_ERROR)); |
---|
593 | |
---|
594 | public static final StandardClass UNBOUND_VARIABLE = |
---|
595 | addStandardClass(Symbol.UNBOUND_VARIABLE, list(CELL_ERROR)); |
---|
596 | |
---|
597 | public static final StandardClass UNDEFINED_FUNCTION = |
---|
598 | addStandardClass(Symbol.UNDEFINED_FUNCTION, list(CELL_ERROR)); |
---|
599 | |
---|
600 | public static final StandardClass JAVA_EXCEPTION = |
---|
601 | addStandardClass(Symbol.JAVA_EXCEPTION, list(ERROR)); |
---|
602 | |
---|
603 | public static final StandardClass METHOD = |
---|
604 | addStandardClass(Symbol.METHOD, list(METAOBJECT)); |
---|
605 | |
---|
606 | public static final StandardClass STANDARD_METHOD = |
---|
607 | addStandardClass(Symbol.STANDARD_METHOD, list(METHOD)); |
---|
608 | |
---|
609 | public static final StandardClass STANDARD_GENERIC_FUNCTION = |
---|
610 | new StandardGenericFunctionClass(); |
---|
611 | static |
---|
612 | { |
---|
613 | addClass(Symbol.STANDARD_GENERIC_FUNCTION, STANDARD_GENERIC_FUNCTION); |
---|
614 | } |
---|
615 | |
---|
616 | public static void initializeStandardClasses() |
---|
617 | { |
---|
618 | // We need to call setDirectSuperclass() here for classes that have a |
---|
619 | // BuiltInClass as a superclass. See comment above (at first mention of |
---|
620 | // STANDARD_OBJECT). |
---|
621 | STANDARD_CLASS.setDirectSuperclass(CLASS); |
---|
622 | STANDARD_OBJECT.setDirectSuperclass(BuiltInClass.CLASS_T); |
---|
623 | FUNCALLABLE_STANDARD_OBJECT.setDirectSuperclasses(list(STANDARD_OBJECT, BuiltInClass.FUNCTION)); |
---|
624 | GENERIC_FUNCTION.setDirectSuperclasses(list(METAOBJECT, |
---|
625 | FUNCALLABLE_STANDARD_OBJECT)); |
---|
626 | |
---|
627 | ARITHMETIC_ERROR.setCPL(ARITHMETIC_ERROR, ERROR, SERIOUS_CONDITION, |
---|
628 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
629 | ARITHMETIC_ERROR.setDirectSlotDefinitions( |
---|
630 | list(new SlotDefinition(Symbol.OPERATION, |
---|
631 | list(PACKAGE_CL.intern("ARITHMETIC-ERROR-OPERATION"))), |
---|
632 | new SlotDefinition(Symbol.OPERANDS, |
---|
633 | list(PACKAGE_CL.intern("ARITHMETIC-ERROR-OPERANDS"))))); |
---|
634 | BUILT_IN_CLASS.setCPL(BUILT_IN_CLASS, CLASS, SPECIALIZER, METAOBJECT, STANDARD_OBJECT, |
---|
635 | BuiltInClass.CLASS_T); |
---|
636 | CELL_ERROR.setCPL(CELL_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
637 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
638 | CELL_ERROR.setDirectSlotDefinitions( |
---|
639 | list(new SlotDefinition(Symbol.NAME, |
---|
640 | list(Symbol.CELL_ERROR_NAME)))); |
---|
641 | CLASS.setCPL(CLASS, SPECIALIZER, METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
642 | CONDITION.setCPL(CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
643 | CONDITION.setDirectSlotDefinitions( |
---|
644 | list(new SlotDefinition(Symbol.FORMAT_CONTROL, |
---|
645 | list(Symbol.SIMPLE_CONDITION_FORMAT_CONTROL)), |
---|
646 | new SlotDefinition(Symbol.FORMAT_ARGUMENTS, |
---|
647 | list(Symbol.SIMPLE_CONDITION_FORMAT_ARGUMENTS), |
---|
648 | NIL))); |
---|
649 | CONDITION.setDirectDefaultInitargs(list(list(Keyword.FORMAT_ARGUMENTS, |
---|
650 | NIL, |
---|
651 | constantlyNil))); |
---|
652 | CONTROL_ERROR.setCPL(CONTROL_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
653 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
654 | DIVISION_BY_ZERO.setCPL(DIVISION_BY_ZERO, ARITHMETIC_ERROR, ERROR, |
---|
655 | SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
656 | BuiltInClass.CLASS_T); |
---|
657 | END_OF_FILE.setCPL(END_OF_FILE, STREAM_ERROR, ERROR, SERIOUS_CONDITION, |
---|
658 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
659 | ERROR.setCPL(ERROR, SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
660 | BuiltInClass.CLASS_T); |
---|
661 | FILE_ERROR.setCPL(FILE_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
662 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
663 | FILE_ERROR.setDirectSlotDefinitions( |
---|
664 | list(new SlotDefinition(Symbol.PATHNAME, |
---|
665 | list(PACKAGE_CL.intern("FILE-ERROR-PATHNAME"))))); |
---|
666 | FLOATING_POINT_INEXACT.setCPL(FLOATING_POINT_INEXACT, ARITHMETIC_ERROR, |
---|
667 | ERROR, SERIOUS_CONDITION, CONDITION, |
---|
668 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
669 | FLOATING_POINT_INVALID_OPERATION.setCPL(FLOATING_POINT_INVALID_OPERATION, |
---|
670 | ARITHMETIC_ERROR, ERROR, |
---|
671 | SERIOUS_CONDITION, CONDITION, |
---|
672 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
673 | FLOATING_POINT_OVERFLOW.setCPL(FLOATING_POINT_OVERFLOW, ARITHMETIC_ERROR, |
---|
674 | ERROR, SERIOUS_CONDITION, CONDITION, |
---|
675 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
676 | FLOATING_POINT_UNDERFLOW.setCPL(FLOATING_POINT_UNDERFLOW, ARITHMETIC_ERROR, |
---|
677 | ERROR, SERIOUS_CONDITION, CONDITION, |
---|
678 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
679 | FORWARD_REFERENCED_CLASS.setCPL(FORWARD_REFERENCED_CLASS, CLASS, |
---|
680 | SPECIALIZER, METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
681 | // Not all of these slots are necessary, but for now we take the |
---|
682 | // standard layout. Instances of this class will be redefined and |
---|
683 | // get a new layout in due course. |
---|
684 | FORWARD_REFERENCED_CLASS.setClassLayout(layoutStandardClass); |
---|
685 | FORWARD_REFERENCED_CLASS.setDirectSlotDefinitions(standardClassSlotDefinitions()); |
---|
686 | FUNCALLABLE_STANDARD_OBJECT.setCPL(FUNCALLABLE_STANDARD_OBJECT, |
---|
687 | STANDARD_OBJECT, BuiltInClass.FUNCTION, |
---|
688 | BuiltInClass.CLASS_T); |
---|
689 | GENERIC_FUNCTION.setCPL(GENERIC_FUNCTION, METAOBJECT, |
---|
690 | FUNCALLABLE_STANDARD_OBJECT, STANDARD_OBJECT, |
---|
691 | BuiltInClass.FUNCTION, |
---|
692 | BuiltInClass.CLASS_T); |
---|
693 | JAVA_EXCEPTION.setCPL(JAVA_EXCEPTION, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
694 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
695 | JAVA_EXCEPTION.setDirectSlotDefinitions( |
---|
696 | list(new SlotDefinition(Symbol.CAUSE, list(Symbol.JAVA_EXCEPTION_CAUSE)))); |
---|
697 | METAOBJECT.setCPL(METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
698 | SPECIALIZER.setCPL(SPECIALIZER, METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
699 | METHOD.setCPL(METHOD, METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
700 | STANDARD_METHOD.setCPL(STANDARD_METHOD, METHOD, METAOBJECT, STANDARD_OBJECT, |
---|
701 | BuiltInClass.CLASS_T); |
---|
702 | STANDARD_METHOD.setDirectSlotDefinitions( |
---|
703 | list(new SlotDefinition(Symbol._GENERIC_FUNCTION, NIL, constantlyNil, |
---|
704 | list(internKeyword("GENERIC-FUNCTION"))), |
---|
705 | new SlotDefinition(Symbol.LAMBDA_LIST, NIL, constantlyNil), |
---|
706 | new SlotDefinition(Symbol.KEYWORDS, NIL, constantlyNil), |
---|
707 | new SlotDefinition(Symbol.OTHER_KEYWORDS_P, NIL, constantlyNil), |
---|
708 | new SlotDefinition(Symbol.SPECIALIZERS, NIL, constantlyNil), |
---|
709 | new SlotDefinition(Symbol.QUALIFIERS, NIL, constantlyNil), |
---|
710 | new SlotDefinition(Symbol._FUNCTION, NIL, constantlyNil, |
---|
711 | list(internKeyword("FUNCTION"))), |
---|
712 | new SlotDefinition(Symbol.FAST_FUNCTION, NIL, constantlyNil), |
---|
713 | new SlotDefinition(Symbol._DOCUMENTATION, NIL, constantlyNil, |
---|
714 | list(internKeyword("DOCUMENTATION"))))); |
---|
715 | PACKAGE_ERROR.setCPL(PACKAGE_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
716 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
717 | PACKAGE_ERROR.setDirectSlotDefinitions( |
---|
718 | list(new SlotDefinition(Symbol.PACKAGE, |
---|
719 | list(PACKAGE_CL.intern("PACKAGE-ERROR-PACKAGE"))))); |
---|
720 | PARSE_ERROR.setCPL(PARSE_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
721 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
722 | PRINT_NOT_READABLE.setCPL(PRINT_NOT_READABLE, ERROR, SERIOUS_CONDITION, |
---|
723 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
724 | PRINT_NOT_READABLE.setDirectSlotDefinitions( |
---|
725 | list(new SlotDefinition(Symbol.OBJECT, |
---|
726 | list(PACKAGE_CL.intern("PRINT-NOT-READABLE-OBJECT"))))); |
---|
727 | PROGRAM_ERROR.setCPL(PROGRAM_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
728 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
729 | READER_ERROR.setCPL(READER_ERROR, PARSE_ERROR, STREAM_ERROR, ERROR, |
---|
730 | SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
731 | BuiltInClass.CLASS_T); |
---|
732 | SERIOUS_CONDITION.setCPL(SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
733 | BuiltInClass.CLASS_T); |
---|
734 | SIMPLE_CONDITION.setCPL(SIMPLE_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
735 | BuiltInClass.CLASS_T); |
---|
736 | SIMPLE_ERROR.setCPL(SIMPLE_ERROR, SIMPLE_CONDITION, ERROR, |
---|
737 | SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
738 | BuiltInClass.CLASS_T); |
---|
739 | SIMPLE_TYPE_ERROR.setDirectSuperclasses(list(SIMPLE_CONDITION, |
---|
740 | TYPE_ERROR)); |
---|
741 | SIMPLE_TYPE_ERROR.setCPL(SIMPLE_TYPE_ERROR, SIMPLE_CONDITION, |
---|
742 | TYPE_ERROR, ERROR, SERIOUS_CONDITION, |
---|
743 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
744 | SIMPLE_WARNING.setDirectSuperclasses(list(SIMPLE_CONDITION, WARNING)); |
---|
745 | SIMPLE_WARNING.setCPL(SIMPLE_WARNING, SIMPLE_CONDITION, WARNING, |
---|
746 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
747 | STANDARD_CLASS.setCPL(STANDARD_CLASS, CLASS, SPECIALIZER, METAOBJECT, |
---|
748 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
749 | FUNCALLABLE_STANDARD_CLASS.setCPL(FUNCALLABLE_STANDARD_CLASS, CLASS, |
---|
750 | SPECIALIZER, METAOBJECT, STANDARD_OBJECT, |
---|
751 | BuiltInClass.CLASS_T); |
---|
752 | // funcallable-standard-class has the same interface as |
---|
753 | // standard-class. |
---|
754 | FUNCALLABLE_STANDARD_CLASS.setClassLayout(layoutStandardClass); |
---|
755 | FUNCALLABLE_STANDARD_CLASS.setDirectSlotDefinitions(standardClassSlotDefinitions()); |
---|
756 | STANDARD_OBJECT.setCPL(STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
757 | STORAGE_CONDITION.setCPL(STORAGE_CONDITION, SERIOUS_CONDITION, CONDITION, |
---|
758 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
759 | STREAM_ERROR.setCPL(STREAM_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
760 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
761 | STREAM_ERROR.setDirectSlotDefinitions( |
---|
762 | list(new SlotDefinition(Symbol.STREAM, |
---|
763 | list(PACKAGE_CL.intern("STREAM-ERROR-STREAM"))))); |
---|
764 | STRUCTURE_CLASS.setCPL(STRUCTURE_CLASS, CLASS, SPECIALIZER, METAOBJECT, |
---|
765 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
766 | STYLE_WARNING.setCPL(STYLE_WARNING, WARNING, CONDITION, STANDARD_OBJECT, |
---|
767 | BuiltInClass.CLASS_T); |
---|
768 | TYPE_ERROR.setCPL(TYPE_ERROR, ERROR, SERIOUS_CONDITION, CONDITION, |
---|
769 | STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
770 | TYPE_ERROR.setDirectSlotDefinitions( |
---|
771 | list(new SlotDefinition(Symbol.DATUM, |
---|
772 | list(PACKAGE_CL.intern("TYPE-ERROR-DATUM"))), |
---|
773 | new SlotDefinition(Symbol.EXPECTED_TYPE, |
---|
774 | list(PACKAGE_CL.intern("TYPE-ERROR-EXPECTED-TYPE"))))); |
---|
775 | UNBOUND_SLOT.setCPL(UNBOUND_SLOT, CELL_ERROR, ERROR, SERIOUS_CONDITION, |
---|
776 | CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
777 | UNBOUND_SLOT.setDirectSlotDefinitions( |
---|
778 | list(new SlotDefinition(Symbol.INSTANCE, |
---|
779 | list(PACKAGE_CL.intern("UNBOUND-SLOT-INSTANCE"))))); |
---|
780 | UNBOUND_VARIABLE.setCPL(UNBOUND_VARIABLE, CELL_ERROR, ERROR, |
---|
781 | SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
782 | BuiltInClass.CLASS_T); |
---|
783 | UNDEFINED_FUNCTION.setCPL(UNDEFINED_FUNCTION, CELL_ERROR, ERROR, |
---|
784 | SERIOUS_CONDITION, CONDITION, STANDARD_OBJECT, |
---|
785 | BuiltInClass.CLASS_T); |
---|
786 | WARNING.setCPL(WARNING, CONDITION, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
787 | |
---|
788 | // Condition classes. |
---|
789 | STANDARD_CLASS.finalizeClass(); |
---|
790 | STANDARD_OBJECT.finalizeClass(); |
---|
791 | FUNCALLABLE_STANDARD_OBJECT.finalizeClass(); |
---|
792 | FUNCALLABLE_STANDARD_CLASS.finalizeClass(); |
---|
793 | FORWARD_REFERENCED_CLASS.finalizeClass(); |
---|
794 | GENERIC_FUNCTION.finalizeClass(); |
---|
795 | ARITHMETIC_ERROR.finalizeClass(); |
---|
796 | CELL_ERROR.finalizeClass(); |
---|
797 | CONDITION.finalizeClass(); |
---|
798 | CONTROL_ERROR.finalizeClass(); |
---|
799 | DIVISION_BY_ZERO.finalizeClass(); |
---|
800 | END_OF_FILE.finalizeClass(); |
---|
801 | ERROR.finalizeClass(); |
---|
802 | FILE_ERROR.finalizeClass(); |
---|
803 | FLOATING_POINT_INEXACT.finalizeClass(); |
---|
804 | FLOATING_POINT_INVALID_OPERATION.finalizeClass(); |
---|
805 | FLOATING_POINT_OVERFLOW.finalizeClass(); |
---|
806 | FLOATING_POINT_UNDERFLOW.finalizeClass(); |
---|
807 | JAVA_EXCEPTION.finalizeClass(); |
---|
808 | METAOBJECT.finalizeClass(); |
---|
809 | METHOD.finalizeClass(); |
---|
810 | STANDARD_METHOD.finalizeClass(); |
---|
811 | SPECIALIZER.finalizeClass(); |
---|
812 | CLASS.finalizeClass(); |
---|
813 | BUILT_IN_CLASS.finalizeClass(); |
---|
814 | PACKAGE_ERROR.finalizeClass(); |
---|
815 | PARSE_ERROR.finalizeClass(); |
---|
816 | PRINT_NOT_READABLE.finalizeClass(); |
---|
817 | PROGRAM_ERROR.finalizeClass(); |
---|
818 | READER_ERROR.finalizeClass(); |
---|
819 | SERIOUS_CONDITION.finalizeClass(); |
---|
820 | SIMPLE_CONDITION.finalizeClass(); |
---|
821 | SIMPLE_ERROR.finalizeClass(); |
---|
822 | SIMPLE_TYPE_ERROR.finalizeClass(); |
---|
823 | SIMPLE_WARNING.finalizeClass(); |
---|
824 | STORAGE_CONDITION.finalizeClass(); |
---|
825 | STREAM_ERROR.finalizeClass(); |
---|
826 | STYLE_WARNING.finalizeClass(); |
---|
827 | TYPE_ERROR.finalizeClass(); |
---|
828 | UNBOUND_SLOT.finalizeClass(); |
---|
829 | UNBOUND_VARIABLE.finalizeClass(); |
---|
830 | UNDEFINED_FUNCTION.finalizeClass(); |
---|
831 | WARNING.finalizeClass(); |
---|
832 | |
---|
833 | // SYS:SLOT-DEFINITION is constructed and finalized in |
---|
834 | // SlotDefinitionClass.java, but we need to fill in a few things here. |
---|
835 | Debug.assertTrue(SLOT_DEFINITION.isFinalized()); |
---|
836 | SLOT_DEFINITION.setCPL(SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT, |
---|
837 | BuiltInClass.CLASS_T); |
---|
838 | SLOT_DEFINITION.setDirectSlotDefinitions(SLOT_DEFINITION.getClassLayout().generateSlotDefinitions()); |
---|
839 | // There are no inherited slots. |
---|
840 | SLOT_DEFINITION.setSlotDefinitions(SLOT_DEFINITION.getDirectSlotDefinitions()); |
---|
841 | |
---|
842 | DIRECT_SLOT_DEFINITION.setCPL(DIRECT_SLOT_DEFINITION, SLOT_DEFINITION, |
---|
843 | METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
844 | DIRECT_SLOT_DEFINITION.finalizeClass(); |
---|
845 | EFFECTIVE_SLOT_DEFINITION.setCPL(EFFECTIVE_SLOT_DEFINITION, SLOT_DEFINITION, |
---|
846 | METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
847 | EFFECTIVE_SLOT_DEFINITION.finalizeClass(); |
---|
848 | STANDARD_SLOT_DEFINITION.setCPL(STANDARD_SLOT_DEFINITION, SLOT_DEFINITION, |
---|
849 | METAOBJECT, STANDARD_OBJECT, BuiltInClass.CLASS_T); |
---|
850 | STANDARD_SLOT_DEFINITION.finalizeClass(); |
---|
851 | STANDARD_DIRECT_SLOT_DEFINITION.setCPL(STANDARD_DIRECT_SLOT_DEFINITION, STANDARD_SLOT_DEFINITION, |
---|
852 | DIRECT_SLOT_DEFINITION, SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT, |
---|
853 | BuiltInClass.CLASS_T); |
---|
854 | STANDARD_DIRECT_SLOT_DEFINITION.finalizeClass(); |
---|
855 | STANDARD_EFFECTIVE_SLOT_DEFINITION.setCPL(STANDARD_EFFECTIVE_SLOT_DEFINITION, STANDARD_SLOT_DEFINITION, |
---|
856 | EFFECTIVE_SLOT_DEFINITION, SLOT_DEFINITION, METAOBJECT, STANDARD_OBJECT, |
---|
857 | BuiltInClass.CLASS_T); |
---|
858 | STANDARD_EFFECTIVE_SLOT_DEFINITION.finalizeClass(); |
---|
859 | |
---|
860 | // STANDARD-GENERIC-FUNCTION |
---|
861 | Debug.assertTrue(STANDARD_GENERIC_FUNCTION.isFinalized()); |
---|
862 | STANDARD_GENERIC_FUNCTION.setCPL(STANDARD_GENERIC_FUNCTION, |
---|
863 | GENERIC_FUNCTION, METAOBJECT, |
---|
864 | FUNCALLABLE_STANDARD_OBJECT, |
---|
865 | STANDARD_OBJECT, |
---|
866 | BuiltInClass.FUNCTION, |
---|
867 | BuiltInClass.CLASS_T); |
---|
868 | STANDARD_GENERIC_FUNCTION.setDirectSlotDefinitions( |
---|
869 | list(new SlotDefinition(PACKAGE_SYS.intern("NAME"), NIL, constantlyNil), |
---|
870 | new SlotDefinition(PACKAGE_SYS.intern("LAMBDA-LIST"), NIL, |
---|
871 | constantlyNil), |
---|
872 | new SlotDefinition(PACKAGE_SYS.intern("REQUIRED-ARGS"), NIL, |
---|
873 | constantlyNil), |
---|
874 | new SlotDefinition(PACKAGE_SYS.intern("OPTIONAL-ARGS"), NIL, |
---|
875 | constantlyNil), |
---|
876 | new SlotDefinition(PACKAGE_SYS.intern("INITIAL-METHODS"), NIL, |
---|
877 | constantlyNil), |
---|
878 | new SlotDefinition(PACKAGE_SYS.intern("METHODS"), NIL, |
---|
879 | constantlyNil), |
---|
880 | new SlotDefinition(PACKAGE_SYS.intern("METHOD-CLASS"), NIL, |
---|
881 | constantlyNil), |
---|
882 | new SlotDefinition(PACKAGE_SYS.intern("%METHOD-COMBINATION"), NIL, |
---|
883 | constantlyNil, |
---|
884 | list(internKeyword("METHOD-COMBINATION"))), |
---|
885 | new SlotDefinition(PACKAGE_SYS.intern("ARGUMENT-PRECEDENCE-ORDER"), |
---|
886 | NIL, constantlyNil), |
---|
887 | new SlotDefinition(PACKAGE_SYS.intern("DECLARATIONS"), NIL, |
---|
888 | constantlyNil), |
---|
889 | new SlotDefinition(PACKAGE_SYS.intern("CLASSES-TO-EMF-TABLE"), NIL, |
---|
890 | constantlyNil), |
---|
891 | new SlotDefinition(Symbol._DOCUMENTATION, NIL, constantlyNil, |
---|
892 | list(internKeyword("DOCUMENTATION"))))); |
---|
893 | // There are no inherited slots. |
---|
894 | STANDARD_GENERIC_FUNCTION.setSlotDefinitions(STANDARD_GENERIC_FUNCTION.getDirectSlotDefinitions()); |
---|
895 | } |
---|
896 | } |
---|