Changeset 14008
- Timestamp:
- 07/15/12 10:38:05 (9 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
r13983 r14008 71 71 } 72 72 73 public StandardGenericFunction(String name, Package pkg, boolean exported,74 Function function, LispObject lambdaList,75 LispObject specializers)76 {77 this();78 Symbol symbol;79 if (exported)80 symbol = pkg.internAndExport(name.toUpperCase());81 else82 symbol = pkg.intern(name.toUpperCase());83 symbol.setSymbolFunction(this);84 this.function = function;85 slots[StandardGenericFunctionClass.SLOT_INDEX_NAME] = symbol;86 slots[StandardGenericFunctionClass.SLOT_INDEX_LAMBDA_LIST] =87 lambdaList;88 slots[StandardGenericFunctionClass.SLOT_INDEX_REQUIRED_ARGS] =89 lambdaList;90 slots[StandardGenericFunctionClass.SLOT_INDEX_OPTIONAL_ARGS] =91 NIL;92 numberOfRequiredArgs = lambdaList.length();93 slots[StandardGenericFunctionClass.SLOT_INDEX_INITIAL_METHODS] =94 NIL;95 StandardObject method96 = (StandardObject)StandardClass.STANDARD_METHOD.allocateInstance();97 method.setInstanceSlotValue(Symbol._GENERIC_FUNCTION, this);98 method.setInstanceSlotValue(Symbol.LAMBDA_LIST, lambdaList);99 method.setInstanceSlotValue(Symbol.KEYWORDS, NIL);100 method.setInstanceSlotValue(Symbol.OTHER_KEYWORDS_P, NIL);101 method.setInstanceSlotValue(Symbol.SPECIALIZERS, specializers);102 method.setInstanceSlotValue(Symbol.QUALIFIERS, NIL);103 // Setting the function slot to nil is a transcription of what the104 // constructor for StandardMethod instances did (that Java class was105 // removed for the implementation of subclassable standard-method).106 // (rudi 2012-01-27)107 method.setInstanceSlotValue(Symbol._FUNCTION, NIL);108 method.setInstanceSlotValue(Symbol.FAST_FUNCTION, function);109 method.setInstanceSlotValue(Symbol._DOCUMENTATION, NIL);110 slots[StandardGenericFunctionClass.SLOT_INDEX_METHODS] =111 list(method);112 slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_CLASS] =113 StandardClass.STANDARD_METHOD;114 slots[StandardGenericFunctionClass.SLOT_INDEX_METHOD_COMBINATION] =115 Symbol.STANDARD; // fixed up by shared-initialize :after in clos.lisp116 slots[StandardGenericFunctionClass.SLOT_INDEX_ARGUMENT_PRECEDENCE_ORDER] =117 NIL;118 slots[StandardGenericFunctionClass.SLOT_INDEX_DECLARATIONS] = NIL;119 slots[StandardGenericFunctionClass.SLOT_INDEX_CLASSES_TO_EMF_TABLE] =120 NIL;121 slots[StandardGenericFunctionClass.SLOT_INDEX_DOCUMENTATION] = NIL;122 }123 124 73 void finalizeInternal() 125 74 { … … 804 753 }; 805 754 806 private static final StandardGenericFunction GENERIC_FUNCTION_NAME =807 new StandardGenericFunction("generic-function-name",808 PACKAGE_MOP,809 true,810 _GENERIC_FUNCTION_NAME,811 list(Symbol.GENERIC_FUNCTION),812 list(StandardClass.STANDARD_GENERIC_FUNCTION));813 814 755 private static class CacheEntry 815 756 { -
trunk/abcl/src/org/armedbear/lisp/clos.lisp
r14007 r14008 1473 1473 ;;; These are defined with % in package SYS, defined as functions here 1474 1474 ;;; and redefined as generic functions once we're all set up. 1475 1476 (defun generic-function-name (gf) 1477 (%generic-function-name gf)) 1475 1478 1476 1479 (defun generic-function-lambda-list (gf)
Note: See TracChangeset
for help on using the changeset viewer.