[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: type specifiers in slot descriptors



I think the following patch fixes the problem you described.
In the original, the order of the dolist forms below were reversed.
This added new accessors and then deleted them.

k

;;; KRA: reversed order of dolist forms.
(defun update-slot-accessors--class-2 (class slotd forcep new old acc/rea)
  (flet ((get-gf (name) (ensure-generic-function name)))

    (dolist (gf-name old)
      (when (or forcep (not (memq gf-name new)))
	(ecase acc/rea
	  (:accessor
	    (remove-reader-method class slotd (get-gf gf-name))
	    (remove-writer-method class slotd (get-gf `(setf ,gf-name))))
	  (:reader
	    (remove-reader-method class slotd (get-gf gf-name))))))

    (dolist (gf-name new)
      (when (or forcep (not (memq gf-name old)))
	(ecase acc/rea
	  (:accessor
	    (add-reader-method class slotd (get-gf gf-name))
	    (add-writer-method class slotd (get-gf `(setf ,gf-name)))
	    (do-defmethod-setf-defsetf gf-name
				       (list (or (class-name class) 'x))))
	(:reader
	  (add-reader-method class slotd (get-gf gf-name))))))))