Commit 3f22c191 authored by rschlatte@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar rschlatte@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Move initial initialization of generic functions Lisp-side

parent 6eb60400
......@@ -193,23 +193,7 @@ public class FuncallableStandardObject extends StandardObject
return program_error("Invalid standard class layout for: "
+ arg.princToString() + ".");
}
FuncallableStandardObject o = new FuncallableStandardObject((Layout)l);
if (Symbol.SUBTYPEP.execute(arg, LispClass.findClass(Symbol.STANDARD_GENERIC_FUNCTION)) != NIL) {
// KLUDGE: this initialization should be moved Lisp-side
o.setInstanceSlotValue(Symbol.NAME, NIL);
o.setInstanceSlotValue(Symbol.LAMBDA_LIST, NIL);
o.setInstanceSlotValue(Symbol.REQUIRED_ARGS, NIL);
o.setInstanceSlotValue(Symbol.OPTIONAL_ARGS, NIL);
o.setInstanceSlotValue(Symbol.INITIAL_METHODS, NIL);
o.setInstanceSlotValue(Symbol.METHODS, NIL);
o.setInstanceSlotValue(Symbol.METHOD_CLASS, StandardClass.STANDARD_METHOD);
// method combination class set by clos.lisp:shared-initialize :after
o.setInstanceSlotValue(Symbol._METHOD_COMBINATION, list(Symbol.STANDARD));
o.setInstanceSlotValue(Symbol.ARGUMENT_PRECEDENCE_ORDER, NIL);
o.setInstanceSlotValue(Symbol.DECLARATIONS, NIL);
o.setInstanceSlotValue(Symbol._DOCUMENTATION, NIL);
}
return o;
return new FuncallableStandardObject((Layout)l);
}
return type_error(arg, Symbol.FUNCALLABLE_STANDARD_CLASS);
}
......
......@@ -814,6 +814,11 @@
(defun allocate-funcallable-instance (class)
(let ((instance (sys::%allocate-funcallable-instance class)))
;; KLUDGE: without this, the build fails with unbound-slot
(when (or (eq class +the-standard-generic-function-class+)
(subtypep class +the-standard-generic-function-class+))
(setf (std-slot-value instance 'sys::method-class)
+the-standard-method-class+))
(set-funcallable-instance-function
instance
#'(lambda (&rest args)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment