[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: type specifiers in slot descriptors
- To: "Paul P. Maglio" <maglio%linus@MITRE-BEDFORD.ARPA>
- Subject: Re: type specifiers in slot descriptors
- From: kanderso@WILMA.BBN.COM
- Date: Tue, 26 Apr 88 11:17:27 -0400
- Cc: commonloops.pa@Xerox.COM
- In-reply-to: Your message of Wed, 20 Apr 88 12:57:53 -0400. <8804201657.AA03331@faron.sun.uucp>
- Redistributed: commonloops.pa
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))))))))