-(defmethod effective-slot-definition-class ((class child-class) initargs)
- (case (getf initargs :allocation)
- (:arg (find-class 'effective-child-slot-definition))
- (t (call-next-method))))
-
-
-(defmethod compute-virtual-slot-location
- ((class child-class) (slotd effective-child-slot-definition) direct-slotds)
- (with-slots (type) slotd
- (let ((location (slot-definition-location (first direct-slotds)))
- (type-number (find-type-number type))
- (reader (get-reader-function type))
- (writer (get-writer-function type))
- (destroy (get-destroy-function type)))
- (list
- #'(lambda (object)
- (with-slots (parent child) object
- (with-gc-disabled
- (let ((arg (arg-new type-number)))
- (setf (arg-name arg) location)
- (container-child-get-arg parent child arg)
- (prog1
- (funcall reader arg +arg-value-offset+)
- (arg-free arg t t))))))
- #'(lambda (value object)
- (with-slots (parent child) object
- (with-gc-disabled
- (let ((arg (arg-new type-number)))
- (setf (arg-name arg) location)
- (funcall writer value arg +arg-value-offset+)
- (container-child-set-arg parent child arg)
- (funcall destroy arg +arg-value-offset+)
- (arg-free arg nil)
- value))))))))
-
-
-(defmethod pcl::add-reader-method ((class child-class) generic-function slot-name)
- (add-method
- generic-function
- (make-instance 'standard-method
- :specializers (list (find-class 'widget))
- :lambda-list '(widget)
- :function #'(lambda (args next-methods)
- (declare (ignore next-methods))
- (child-slot-value (first args) slot-name)))))
-
-(defmethod pcl::add-writer-method
- ((class child-class) generic-function slot-name)
- (add-method
- generic-function
- (make-instance 'standard-method
- :specializers (list (find-class t) (find-class 'widget))
- :lambda-list '(value widget)
- :function #'(lambda (args next-methods)
- (declare (ignore next-methods))
- (destructuring-bind (value widget) args
- (setf
- (child-slot-value widget slot-name)
- value))))))