Re: OO and dynamic classes and methods...

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Fri, 03 Feb 1995 15:18:37 +0000

> Is it possible to re-define a class and then have the respective
> instances reflect the new definition?

No it is not possible and the design of STklos was explicitely done to avoid
this. CLOS permits this but it conduct to weird situations:

        1. it implies that classes are not real "first class" object (in CLOS
        you have to say (make-instance 'the-class), note the quote which
        in fact permits to designate an entry in a hash table which permits
        to find the structure of the object...
        I found this was more schemish

        2. it costs a lot since a class must know all its instances and have a
        link over them

        3. it complicates the semantics of slots redefinition. When you add
        or delete a slot, things are relatively clear but when you change
        some of its properties (such as its initform -- not too complicate, or
        its allocation -- more complex) things are more difficult to understand
        
        4. Most of the time, it is convenient only when develooping an
         application (it is rare that the class of an object change during
        its execution). My guess was that it would be faster to have a
        simplist system where you reload things when you see that you have
        a slot which is missing or no more useful, rather than having an
        "intelligent" system where you have to pay an overhead even if you don't
        use this feature (cause of 2, principally).
        to reload all than

I hope I have convinced you of the usefulness of this feature :)


                -- Erick
Received on Fri Feb 03 1995 - 15:20:07 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST