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

Re: getting at the slots in a class

>How do you get a list of the slots (names) in a class?  Old object lisp code 
>like this worked:
>        (defmethod (get-slots my-class) ()
>                (local-vars self))
>Is there a similar predefined function like local-vars in CLOS?

Well, I think these aren't officially supported, but these may do 
the trick for you:

  (class-class-slots <class>)     ; Returns the CLASS-SLOTS of <class>
  (class-instance-slots <class>)  ; Returns the INSTANCE-SLOTS of <class>