From: Kevin M. Rosenberg Date: Sat, 29 Mar 2003 20:11:09 +0000 (+0000) Subject: r4284: Auto commit for Debian build X-Git-Tag: debian-2.11.0-2~185 X-Git-Url: http://git.kpe.io/?p=hyperobject.git;a=commitdiff_plain;h=224c382d0d7fa09a5c86bfb1a8479ac380a094c6 r4284: Auto commit for Debian build --- diff --git a/mop.lisp b/mop.lisp index 03cb099..0002d56 100644 --- 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 ;;;; @@ -281,6 +281,29 @@ (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) @@ -297,10 +320,15 @@ 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))) diff --git a/package.lisp b/package.lisp index 42e51ef..b567852 100644 --- a/package.lisp +++ b/package.lisp @@ -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 ;;;; ************************************************************************* @@ -50,17 +50,21 @@ 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)) @@ -95,3 +105,4 @@ (setq cl:*features* (delete :kmr-sbcl-mop cl:*features*)) (setq cl:*features* (delete :kmr-sbcl-pcl cl:*features*)))) +