[Top][All Lists]

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

Re: GOOPS %modify-[instance|class]

From: Clinton Ebadi
Subject: Re: GOOPS %modify-[instance|class]
Date: Sun, 12 Jan 2003 16:45:09 -0500
User-agent: KMail/1.4.2

On Friday 10 January 2003 05:12, Mikael Djurfeldt wrote:
> Clinton Ebadi <address@hidden> writes:
> > I think %modify-instance and -class should be public.
> Could you be more specific why?  These seem pretty strange and magical
> to me, and might change as the implementation evolves...

They swap the class in place. It seems that if I don't do that then all of my 
objects that point to the class being changed remain being part of that class 
and then only new objects can be created with the changed class. My 
understanding of the MOP is a bit fuzzy so I'm probably wrong.

> > I specialized change-class and change-object-class (to the same
> > thing, just to be safe because the manual says either one may be
> > called but not both).
> The manual shouldn't mention change-object-class since that is a
> private part of the implementation.  BTW, change-class is a generic
> function while change-object-class is a prociedure.

See the GOOPS Manual, Mop Specification, Class Redefinition. It says "[*fixme* 
Actually it sometimes calls change-class and sometimes change-object-class, 
and I don't understand why.]" 

> > I seem to have a problem: when I return the updated class, all my
> > pointers to the old class are invalidated! And then it seems that
> > GOOPS continues in an infinite loops updated the same objects over
> > and over again.
> Could you please explain what you want to do.  You talk about
> returning an updated class.  But this only happens if one is using
> change-class to change the metaclass of a class instance.  The normal
> job for change-class is to change the class of an instance.

I meant an instance (sorry about that).

> Could you please give me enough information to reproduce the infinite
> loop you are talking about?

My code is at (it has other 
problems and after I get the class redefinition to work it still won't work 
but I'd just have to do one more thing). I modified it and now it says slot 
'object is unbound (I marked the line this happens at in the source). I 
didn't want anyone to see it because the code is a bit of a hack and 
sucks...(sorry for taking so long to reply but I've had to put in really long 
shifts at work the last few days)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]