r4284: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 29 Mar 2003 20:11:09 +0000 (20:11 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 29 Mar 2003 20:11:09 +0000 (20:11 +0000)
mop.lisp
package.lisp

index 03cb099a3bc36fbe90dd8eacd8996b6e380dd1b1..0002d566f2f016374a6c3175232660bb9570e7b5 100644 (file)
--- a/mop.lisp
+++ b/mop.lisp
@@ -11,7 +11,7 @@
 ;;;; in Text, HTML, and XML formats. This includes hyperlinking
 ;;;; capability and sub-objects.
 ;;;;
-;;;; $Id: mop.lisp,v 1.26 2003/03/29 13:57:07 kevin Exp $
+;;;; $Id: mop.lisp,v 1.27 2003/03/29 20:11:09 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
 ;;;;
        (setf (slot-value ,the-instance ,the-slot-name)
           (,reader ,@keys)))))
 
+#+(or sbcl scl cmu)
+(defun ensure-lazy-reader (class slot-name reader &rest reader-keys)
+  (let ((keys nil)
+       (gf (ensure-generic-function 'slot-unbound)))
+    (dolist (key reader-keys)
+      (push (list 'slot-value 'the-instance (list 'quote key)) keys))
+    (setq keys (nreverse keys))
+    (multiple-value-bind (method-lambda init-args-values)
+      (make-method-lambda
+       gf
+       (class-prototype (generic-function-method-class gf))
+       `(lambda (the-class the-instance the-slot-name)
+        (declare (ignore the-class))
+        (setf (slot-value the-instance the-slot-name) (,reader ,@keys))))
+       (print init-args-values)
+       (add-method gf
+                 (make-instance (generic-function-method-class gf)
+                                ':specializers (list t class (intern-eql-specializer slot-name))
+                                ':lambda-list '(the-class the-instance the-slot-name)
+                                ':function `(function ,method-lambda)
+                                ;;init-args-values
+                                )))))
+
 (defun finalize-subobjects (cl)
   "Process class subobjects slot"
   (setf (subobjects cl)
                                                           nil
                                                           (cdr subobj-def)))))
            (unless (eq (lookup subobject) t)
+             #-(or sbcl cmu scl)
              (eval
               `(hyperobject::def-lazy-reader ,(name-class subobject)
                 ,(name-slot subobject) ,(lookup subobject)
-                ,@(lookup-keys subobject))))
+                ,@(lookup-keys subobject)))
+             #+(or sbcl cmu scl)
+             (apply #'ensure-lazy-reader 
+                    (name-class subobject) (name-slot subobject) (lookup subobject) (lookup-keys subobject))
+             )
            (push subobject subobjects))))
       subobjects)))
 
index 42e51efbb47df3937d2066f910384d23340af338..b567852e31922790c7b2e620557cc2e965dbb960 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: package.lisp,v 1.34 2003/03/29 04:00:37 kevin Exp $
+;;;; $Id: package.lisp,v 1.35 2003/03/29 20:11:09 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
 ;;;; *************************************************************************
      mop::standard-direct-slot-definition mop::standard-effective-slot-definition
      mop:direct-slot-definition-class mop:compute-effective-slot-definition
      excl::compute-effective-slot-definition-initargs
-     mop:slot-value-using-class)
+     mop:slot-value-using-class
+     mop:class-prototype mop:generic-function-method-class mop:intern-eql-specializer
+     mop:make-method-lambda)
    #+lispworks
    '(clos:class-slots clos::slot-definition-name clos:finalize-inheritance
      clos::standard-direct-slot-definition clos::standard-effective-slot-definition
      clos:direct-slot-definition-class clos:compute-effective-slot-definition
      clos::compute-effective-slot-definition-initargs
-     clos:slot-value-using-class)
+     clos:slot-value-using-class clos:make-method-lambda)
    #+kmr-sbcl-mop 
    '(sb-pcl::standard-direct-slot-definition
      sb-pcl::standard-effective-slot-definition
-     sb-pcl::compute-effective-slot-definition-initargs)
+     sb-pcl::compute-effective-slot-definition-initargs
+     ;sb-pcl:class-prototype sb-pcl:generic-function-method-class sb-pcl:intern-eql-specializer
+     )
    #+kmr-sbcl-pcl
    '(sb-pcl:class-of sb-pcl:class-name sb-pcl:class-slots sb-pcl:find-class
      sb-pcl::standard-class
@@ -69,7 +73,9 @@
      sb-pcl::standard-effective-slot-definition sb-pcl::validate-superclass
      sb-pcl::direct-slot-definition-class sb-pcl::compute-effective-slot-definition
      sb-pcl::compute-effective-slot-definition-initargs
-     sb-pcl::slot-value-using-class)
+     sb-pcl::slot-value-using-class
+     sb-pcl:class-prototype sb-pcl:generic-function-method-class sb-pcl:intern-eql-specializer
+     sb-pcl:make-method-lambda)
   #+cmu
   '(pcl:class-of  pcl:class-name pcl:class-slots pcl:find-class pcl::standard-class
     pcl::slot-definition-name pcl:finalize-inheritance
@@ -77,7 +83,9 @@
     pcl::validate-superclass pcl:direct-slot-definition-class
     pcl:compute-effective-slot-definition
     pcl::compute-effective-slot-definition-initargs
-    pcl::slot-value-using-class)
+    pcl::slot-value-using-class
+    pcl:class-prototype pcl:generic-function-method-class pcl:intern-eql-specializer
+    pcl:make-method-lambda)
   #+scl
   '(clos:class-slots clos::standard-class
     clos::slot-definition-name clos:finalize-inheritance
@@ -85,7 +93,9 @@
     clos::validate-superclass clos:direct-slot-definition-class
     clos:compute-effective-slot-definition
     clos::compute-effective-slot-definition-initargs
-    clos::slot-value-using-class)
+    clos::slot-value-using-class
+    clos:class-prototype clos:generic-function-method-class
+    clos:intern-eql-specializer clos:make-method-lambda)
   
    :hyperobject))
 
       (setq cl:*features* (delete :kmr-sbcl-mop cl:*features*))
       (setq cl:*features* (delete :kmr-sbcl-pcl cl:*features*))))
 
+