oops System


(defmacro defclass
  (class supers slot-specs rest class-options)
  `(defclass-expr (quote ,class) (quote ,supers)
     (quote ,slot-specs) (quote ,class-options)) )

(defun defclass-expr
  (class supers slot-specs class-options)
    (setf (get class 'classp)  t)
    (setf (get class 'supers)  supers)
    (setf (get class 'slots)   slot-specs)
    (setf (get class 'options) class-options)
    class)

(defun classp (class)
  (and (symbolp class) (get class 'classp)))

(defun class-of (object)
  (or (and (symbolp object) (get object 'class))
      (type-of object)))

Contents    Page-10    Prev    Next    Page+10    Index