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

Re: Inheritance of Slots

    So what does this do:

    (defclass c1 () ((s :allocation :class :initform 99)))
    (defclass c2 (c1)((s :initform 22)))

    Is S an :instance in instances of C2 ? Is it a :class in C2?  Is it
    with the one in C1?  Do we reinitialize S?

I can't understand why you found this so confusing.  Before you started
hacking what Moon wrote, I sent out a message which included a different
explanation of these rules and exactly included this example.

I find the inheritance mechanism Moon was describing quite simple (I
agree the description could be improved) all you have to do is get the
slot descriptions in class precedence list order, default them according
to the appropriate rule for each option and then pick the most specific
*supplied* value for each option.  The only thing even remotely complex
is that one of the options (:initform) defaults to *unsupplied*.

I also don't like the new rules you have proposed.