r4665: *** empty log message ***
[kmrcl.git] / attrib-class.lisp
index 7a7bebeef95db6ee2830345aeae3aff548f29789..0b837adda6f44f586a1a58aa25c4e079a6de41af 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: attrib-class.lisp,v 1.4 2002/10/10 16:23:48 kevin Exp $
+;;;; $Id: attrib-class.lisp,v 1.5 2003/04/28 21:12:27 kevin Exp $
 ;;;;
 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 
 (in-package :kmrcl)
 
-(defclass attributes-dsd (mop::standard-direct-slot-definition)
+(defclass attributes-dsd (standard-direct-slot-definition)
   ((attributes :initarg :attributes :initform nil 
               :accessor attributes)))
 
-(defclass attributes-esd (mop::standard-effective-slot-definition)
+(defclass attributes-esd (standard-effective-slot-definition)
   ((attributes :initarg :attributes :initform nil 
               :accessor slot-definition-attributes)))
 
 
-(defclass attributes-class (mop::standard-class)
+(defclass attributes-class (standard-class)
   ()
   )
 
-(defmethod mop::direct-slot-definition-class ((cl attributes-class) 
+#+(or cmu scl sbcl)
+(defmethod validate-superclass ((class attributes-class)
+                               (superclass standard-class))
+  t)
+
+(defmethod direct-slot-definition-class ((cl attributes-class) 
                                              &rest iargs &key attributes)
   (declare (ignorable attributes))
 ;;  (format t "attributes:~s iargs:~s~%" attributes iargs)
   (find-class 'attributes-dsd))
 
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (when (>= (length (generic-function-lambda-list
+                    (ensure-generic-function
+                     'compute-effective-slot-definition)))
+           3)
+    (push :ho-named-cesd-fun cl:*features*)))
 
-(defmethod mop::compute-effective-slot-definition :around
-          ((cl attributes-class) slot dsds)
-  (declare (ignorable slot))
+(defmethod compute-effective-slot-definition :around
+    ((cl attributes-class) #+ho-named-cesd-fun name dsds)
+  #+ho-named-cesd-fun (declare (ignore name))
   (apply
    #'make-instance 'attributes-esd 
    :attributes (remove-duplicates (mapappend #'attributes dsds))
-   (excl::compute-effective-slot-definition-initargs cl dsds))
+   (compute-effective-slot-definition-initargs cl dsds))
   )
 
 
 #+ignore
-(defmethod mop::compute-effective-slot-definition ((cl attributes-class) slot dsds)
-  (declare (ignorable slot))
+(defmethod compute-effective-slot-definition :around
+    ((cl attributes-class) #+ho-named-cesd-fun name dsds)
+  #+ho-named-cesd-fun (declare (ignore name))
   (let ((normal-slot (call-next-method)))
     (setf (slot-definition-attributes normal-slot)
       (remove-duplicates
@@ -61,7 +73,7 @@
     normal-slot))
 
 
-(defmethod mop::compute-slots ((class attributes-class))
+(defmethod compute-slots ((class attributes-class))
   (let* ((normal-slots (call-next-method))
         (alist
          (mapcar
       attr-bucket)))
 
 
-#||
-(in-package :kmrcl)
-
-(defclass credit-rating ()
-  ((level :attributes (date-set time-set))
-   (id :attributes (person-setting)))
-  (:metaclass kmrcl:attributes-class))
-(defparameter cr (make-instance 'credit-rating))
-
-(format t "~&date-set: ~a" (slot-attribute cr 'level 'date-set))
-(setf (slot-attribute cr 'level 'date-set) "12/15/1990")
-(format t "~&date-set: ~a" (slot-attribute cr 'level 'date-set))
-  
-(defclass monitored-credit-rating (credit-rating)
-  ((level :attributes (last-checked interval date-set))
-   (cc :initarg :cc)
-   (id :attributes (verified))
-   )
-  (:metaclass attributes-class))
-(defparameter mcr (make-instance 'monitored-credit-rating))
-
-(setf (slot-attribute mcr 'level 'date-set) "01/05/2002")
-(format t "~&date-set for mcr: ~a" (slot-attribute mcr 'level 'date-set))
-
-||#