X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=mop.lisp;h=9e2706c9f4477375b3d8dcc5caab573aa0f54813;hb=647d539c69157228c414905a06253e5d3b193718;hp=c9fb4f2e89be8863dd4ec747eb1a16b0b23999e6;hpb=2b03b3bd171decdd6aab2846a275f5a63424d689;p=hyperobject.git diff --git a/mop.lisp b/mop.lisp index c9fb4f2..9e2706c 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.72 2003/05/15 06:05:46 kevin Exp $ +;;;; $Id: mop.lisp,v 1.73 2003/05/15 06:30:19 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg ;;;; ************************************************************************* @@ -378,16 +378,16 @@ (defvar *lazy-readers* (make-hash-table)) (defmethod slot-unbound :around ((class hyperobject-class) instance slot-name) - (let ((lazy-reader (loop for super in (mop:class-precedence-list class) - as lazy-reader = (getf (gethash super *lazy-readers*) slot-name) - when lazy-reader return it))) - (if lazy-reader - (setf (slot-value instance slot-name) - (apply (car lazy-reader) - (loop for arg-slot-name in (cdr lazy-reader) - collect (slot-value instance arg-slot-name)))) - ;; No lazy reader -- defer to regular slot-unbound handling. - (call-next-method)))) + (let ((lazy-reader (loop for super in (class-precedence-list class) + as lazy-reader = (getf (gethash super *lazy-readers*) slot-name) + when lazy-reader return it))) + (if lazy-reader + (setf (slot-value instance slot-name) + (apply (car lazy-reader) + (loop for arg-slot-name in (cdr lazy-reader) + collect (slot-value instance arg-slot-name)))) + ;; No lazy reader -- defer to regular slot-unbound handling. + (call-next-method)))) ;; The reader is a function and the reader-keys are slot names. The slot is lazily set to ;; the result of applying the function to the slot-values of those slots, and that value