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

Re: Names, Names



    Danny:

    ``There is no mechanism to handle names for classes specified
    in the metaobject protocol other than symbol-class and class-name.''

    If non-symbols can be names, I'd say there had better be such a
    mechanism.

    			-rpg-

Not if the criterion is that symbol-class does an eql look-up, and class-name is
insensitive to type.  Then ordinary users can write a structure to eql intern
for any structure they care to use, and use symbol-class to find the associated
class.  Thus for the dynamic-class application I mentioned:

(defun get-dynamic-class (class-name-list)
  (let((pair (assoc class-name-list *dynamic-classes* :test #'equal)))
    (if pair
       (symbol-class (cdr pair))
       (let((new-class 
            (make-instance 'standard-class
                :direct-superclasses (mapcar #'symbol-class class-name-list)
                :direct-slots nil)))
;;; make class-name-list be proper name of new-class
          (setf (class-name new-class) class-name-list)
          (setf (symbol-class class-name-list) new-class)
          (setf (assoc class-name-list *dynamic-classes*) class-name-list)
          new-class))))