Changeset 14495
- Timestamp:
- 05/08/13 08:34:32 (11 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/EMFCache.java
r14493 r14495 54 54 } 55 55 56 static final StandardGenericFunctioncheckStandardGenericFunction(LispObject obj)57 { 58 if (obj instanceof StandardGenericFunction)59 return ( StandardGenericFunction) obj;60 return ( StandardGenericFunction) // Not reached.56 static final FuncallableStandardObject checkStandardGenericFunction(LispObject obj) 57 { 58 if (obj instanceof FuncallableStandardObject) 59 return (FuncallableStandardObject) obj; 60 return (FuncallableStandardObject) // Not reached. 61 61 type_error(obj, Symbol.STANDARD_GENERIC_FUNCTION); 62 62 } … … 136 136 public LispObject execute(LispObject generic_function, LispObject eql_specializers) 137 137 { 138 final StandardGenericFunctiongf = checkStandardGenericFunction(generic_function);138 final FuncallableStandardObject gf = checkStandardGenericFunction(generic_function); 139 139 EMFCache cache = gf.cache; 140 140 cache.clearCache(); … … 162 162 LispObject third) 163 163 { 164 final StandardGenericFunctiongf = checkStandardGenericFunction(first);164 final FuncallableStandardObject gf = checkStandardGenericFunction(first); 165 165 EMFCache cache = gf.cache; 166 166 LispObject args = second; … … 192 192 public LispObject execute(LispObject first, LispObject second) 193 193 { 194 final StandardGenericFunctiongf = checkStandardGenericFunction(first);194 final FuncallableStandardObject gf = checkStandardGenericFunction(first); 195 195 EMFCache cache = gf.cache; 196 196 LispObject args = second; -
trunk/abcl/src/org/armedbear/lisp/FuncallableStandardObject.java
r14475 r14495 43 43 LispObject function; 44 44 45 // KLUDGE: this is only needed for generic functions, but doesn't hurt 46 // to have it here. 47 EMFCache cache = new EMFCache(); 48 45 49 protected FuncallableStandardObject() 46 50 { … … 190 194 + arg.princToString() + "."); 191 195 } 196 FuncallableStandardObject o = new FuncallableStandardObject((Layout)l); 192 197 if (arg == StandardClass.STANDARD_GENERIC_FUNCTION || Symbol.SUBTYPEP.execute(arg, StandardClass.STANDARD_GENERIC_FUNCTION) != NIL) { 193 return new StandardGenericFunction((Layout)l); 194 } else { 195 return new FuncallableStandardObject((Layout)l); 198 // KLUDGE: this initialization should be moved Lisp-side 199 o.setInstanceSlotValue(Symbol.NAME, NIL); 200 o.setInstanceSlotValue(Symbol.LAMBDA_LIST, NIL); 201 o.setInstanceSlotValue(Symbol.REQUIRED_ARGS, NIL); 202 o.setInstanceSlotValue(Symbol.OPTIONAL_ARGS, NIL); 203 o.setInstanceSlotValue(Symbol.INITIAL_METHODS, NIL); 204 o.setInstanceSlotValue(Symbol.METHODS, NIL); 205 o.setInstanceSlotValue(Symbol.METHOD_CLASS, StandardClass.STANDARD_METHOD); 206 // method combination class set by clos.lisp:shared-initialize :after 207 o.setInstanceSlotValue(Symbol._METHOD_COMBINATION, list(Symbol.STANDARD)); 208 o.setInstanceSlotValue(Symbol.ARGUMENT_PRECEDENCE_ORDER, NIL); 209 o.setInstanceSlotValue(Symbol.DECLARATIONS, NIL); 210 o.setInstanceSlotValue(Symbol._DOCUMENTATION, NIL); 196 211 } 212 return o; 197 213 } 198 214 return type_error(arg, Symbol.FUNCALLABLE_STANDARD_CLASS);
Note: See TracChangeset
for help on using the changeset viewer.