[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug with initialized class slots
- To: Steve Haflich <smh@franz.com>
- Subject: Re: bug with initialized class slots
- From: Gregor.pa@Xerox.COM
- Date: Fri, 16 Feb 90 10:57 PST
- Cc: commonloops.PA@Xerox.COM
- Fcc: BD:>Gregor>mail>outgoing-mail-8.text.newest
- In-reply-to: <9002140127.AA03687@fiona.Franz.COM>
- Line-fold: no
Date: Tue, 13 Feb 90 17:27:02 PST
From: smh@Franz.COM (Steve Haflich)
In (defvar *pcl-system-date* "2/8/90 A PCL for the 90's (beta 2)")
I believe there is a bug with class-allocated slots that have no
specified initialization. In Allegro 3.1 the first of these defclass
runs OK while the second blows up at DEFCLASS time:
Many people have complained about this bug. I am about to put out a new
set of sources which fixes this and several other bugs, but the
following fixes just this bug.
;from std-class.lisp
(defmethod shared-initialize :after
((class std-class)
slot-names
&key direct-superclasses
direct-slots
direct-default-initargs)
(declare (ignore slot-names))
(when (null direct-superclasses)
(setq direct-superclasses (list *the-class-standard-object*)))
(setq direct-slots
(mapcar #'(lambda (pl) (make-direct-slotd class pl)) direct-slots))
(setf (slot-value class 'direct-superclasses) direct-superclasses
(slot-value class 'direct-slots) direct-slots)
(setf (plist-value class 'direct-default-initargs) direct-default-initargs)
(setf (plist-value class 'class-slot-cells)
(gathering1 (collecting)
(dolist (dslotd direct-slots)
(when (eq (slotd-allocation dslotd) class)
(let ((initfunction (slotd-initfunction dslotd)))
(gather1 (cons (slotd-name dslotd)
(if initfunction (funcall initfunction) *slot-unbound*))))))))
(add-direct-subclasses class direct-superclasses)
(add-slot-accessors class direct-slots))
-------