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

Re: destroying classes



    Date: Thu, 15 Dec 88 10:18:54 PST
    From: Dave Brill <brill@vaxa.isi.edu>

    We are using large PCL nets here, and it takes several minutes to
    redefine a class near the top of the net.  We would like to be able
    to simply rebuild the net under such circumstances.  Will it be
    possible to use "cmakunbound" (when implemented) to expunge PCL
    classes?  Is any mechanism for destroying classes available now?

Three comments:

- PCL is scheduled for some improvement in the speed at which classes
are updated.  The new metaobject protocol makes it possible to do this
much more efficiently than before (thanks to Patrick Dussud).  In
addition, the existing implementation doesn't have to be anywhere near
as stupid as it is.  So, you can expect this to get better.  Over the
years, the flavors implementations have improved dramatically in this
regard.

- cmakunbound is (setf (find-class <class-name>) nil)

- you can use setf with find-class now, and it will have exactly the
specified behavior.

But, that behavior may not be what you are thinking of.  For example,
you will have to reload any methods that mentioned the class by name,
and other things may be surprising.

You have to remember that *basically* CLOS converts names to objects
(metaobjects) at load time, and then manipulates only the metaobjects.
So, doing a setf of find-class to nil (or any other value) doesn't
affect any running code that doesn't explicitly depend on the name to
metaobject mapping.  So, for example, code that calls typep with a
symbol as a second argument or code that calls type-of is affected.
-------