+ ;; KLUDGE: this logic is cut'n'pasted from
+ ;; GET-ACCESSOR-METHOD-FUNCTION, which (for STD-CLASSes) is
+ ;; only called later, because it does things that can't be
+ ;; computed this early in class finalization; however, we need
+ ;; this bit as early as possible. -- CSR, 2009-11-05
+ (setf (slot-accessor-std-p slotd type)
+ (let* ((std-method (standard-svuc-method type))
+ (str-method (structure-svuc-method type))
+ (types1 `((eql ,class) (class-eq ,class) (eql ,slotd)))
+ (types (if (eq type 'writer) `(t ,@types1) types1))
+ (methods (compute-applicable-methods-using-types gf types)))
+ (null (cdr methods))))
+ (setf (slot-accessor-function slotd type)
+ (lambda (&rest args)
+ (declare (dynamic-extent args))
+ ;; FIXME: a tiny amount of wasted SLOT-ACCESSOR-STD-P
+ ;; work here (see KLUDGE comment above).
+ (let ((fun (compute-slot-accessor-info slotd type gf)))
+ (apply fun args))))))))
+
+(defmethod finalize-internal-slot-functions ((slotd effective-slot-definition))
+ (dolist (type '(reader writer boundp))
+ (let* ((gf-name (ecase type
+ (reader 'slot-value-using-class)
+ (writer '(setf slot-value-using-class))
+ (boundp 'slot-boundp-using-class)))
+ (gf (gdefinition gf-name)))
+ (compute-slot-accessor-info slotd type gf))))