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

Re: :type bug?



    Date: Mon, 19 Sep 88 20:23:26 PST
    From: Doug Ruth <RUTH@SRI-ROBOTX.ARPA>

    The following code seems to indicate a bug with respect to slot types:

    (defclass foo () (a))

    (pcl:slotd-type (car (pcl:class-slots (find-class 'foo))))
    T

    (pcl:slotd-type (car (pcl:class-local-slots (find-class 'foo))))
    (*SLOTD-UNSUPPLIED*)

    It seems the type in the local slot description object for slot a should
    also be T.  Am I correct?

No.

This particular behavior is pcl-specific, and will change with the
chapter 3 specification, but in any case, the second call to slotd-type
would never return T.  Consider the following case:

(defclass foo () ((a :type number)))
(defclass bar () ((a)))

Clearly, the following are true:

(slotd-type (car (class-slots (find-class 'foo)))) ==> NUMBER
(slotd-type (car (class-slots (find-class 'bar)))) ==> NUMBER

Furthermore, the following is clearly true.

(slotd-type (car (class-local-slots (find-class 'foo)))) ==> NUMBER

But the following must have some way of noting that the type is not
actually specified in the defclass for bar.  That is what makes it clear
that the type specified in FOO should be used in BAR rather than being
overridden by an implicit T.

(slotd-type (car (class-local-slots (find-class 'bar))))
-------