[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing the :metaclass of a class
- To: Gregor.pa@Xerox.COM
- Subject: Re: Changing the :metaclass of a class
- From: kanderso@DINO.BBN.COM
- Date: Tue, 09 May 89 17:09:46 -0400
- Cc: Darrell <email@example.com>, commonloops.pa@Xerox.COM, Stephanie_Cammarata <firstname.lastname@example.org>
- In-reply-to: Your message of Tue, 02 May 89 10:06:00 -0700. <19890502170618.0.GREGOR@SPIFF.parc.xerox.com>
- Redistributed: commonloops.pa
- Reply-to: <Owners-commonloops.pa@Xerox.COM>
Received: from Semillon.ms by ArpaGateway.ms ; 02 MAY 89 10:15:12 PDT
Date: Tue, 2 May 89 10:06 PDT
Subject: Re: Changing the :metaclass of a class
To: Darrell <email@example.com>
Cc: firstname.lastname@example.org, Stephanie_Cammarata <email@example.com>
Date: Mon, 01 May 89 12:55:17 PDT
From: Darrell <firstname.lastname@example.org>
;;; Why is it that when I change the :metaclass of a class,
;;; the class instance is not changed? For example:
This is because of a structural bug in PCL. Unfortunately, this won't
be fixed in this week's release. It should be fixed this month though.
Note that in almost all cases, you can just use change-class by hand on
the class object.
I had a patch for this in the Cute version of PCL, that I forgot to
mention to anyone. This might work ok until Gregor fixes it.
;;; Patch std-class.lisp
;;; KRA 89/3/30: Let class-change happen if the metaclass of a class changes.
;;; CLASS-FOR-REDEFINITION old-class proto-class name ds-options slotds
;;; protocol: class definition
;;; When a class is being defined, and a class with that name already exists
;;; a decision must be made as to what to use for the new class object, and
;;; whether to update the old class object. For this, class-for-redefinition
;;; is called with the old class object, the prototype of the new class, and
;;; the name ds-options and slotds corresponding to the new definition.
;;; It should return the class object to use as the new definition. It is
;;; OK for this to be old-class if that is appropriate.
(defmethod class-for-redefinition ((old-class standard-class)
(declare (ignore name local-supers local-slot-slotds extra))
(UNLESS (EQ (CLASS-OF OLD-CLASS) (CLASS-OF PROTO-CLASS))
(CHANGE-CLASS OLD-CLASS (CLASS-OF PROTO-CLASS)))