;;;; 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)))
;;;; 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
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
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
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*))))
+