[Bese-devel] Re: say a warm welcome to ucw+, event-based ucw implementing ajax.

Lou Vanek vanek at acd.net
Wed Jul 12 16:34:31 UTC 2006


Evrim,

After a darcs pull on today's ucw+ test1 breaks with this error (clisp 2.38):
   SLOT-VALUE: The slot TRACED-SLOTS of #1=#<UCW+-TEST::TEST1 #x1ECD264D> has no value

I'm pretty sure it's dieing on,

(defmethod shared-initialize :after ((self ajax-widget)
				     slot-names
				     &key &allow-other-keys)
   (setf (slot-value self 'traced-slots)                      <== DIES ON THIS LINE!
	(mapcar #'(lambda (x)
		    (mopp:slot-definition-name x))
		(set-difference
		 (mopp:compute-slots (class-of self))
		 (mopp:compute-slots (find-class 'ajax-widget))
		 :test #'(lambda (a b)
			   (equal (mopp:slot-definition-name a)
				      (mopp:slot-definition-name b)))))))

after calling:

(defentry-point "^test1.*$" (:application *ucw+-test-application*
				     :class regexp-dispatcher) ()
   (call 'test-window))  <= this line is where the test1 widget is being instantiated and dies


The way I fixed it is to revert the following method to the way it was previously defined.
I wish I could follow the mop-magic logic but i can't. Thought you should know.

Lou Vanek



;; new(er) definition (is broke):
(defmethod (setf mopp:slot-value-using-class) :after (new-value
						      (class standard-component-class)
						      (instance ajax-widget)
						      (slot-def standard-component-effective-slot))
   (awhen (find-if #'(lambda (a)
		      (equal (mopp:slot-definition-name a) 'traced-slots))
		  (mopp:compute-slots (find-class 'ajax-widget)))
     (when (and (mopp:slot-boundp-using-class class instance it)
	       (not (null (traced-slots instance)))
	       (member (mopp:slot-definition-name slot-def) (traced-slots instance))
	       (not (member instance (ucw::context.dirty-components ucw::*context*))))
       (pushnew instance (ucw::context.dirty-components ucw::*context*)))))


;; old(er) definition (works *AOK*):
;; for some reason this method either creates 'traced-slots slot or doesn't wipe the
;; field out like the newer version of this method does.
(defmethod (setf mopp:slot-value-using-class) :after
     (new-value
      (class standard-class)
      (instance ajax-widget)
      (slot-def mopp:standard-effective-slot-definition))

   (when (and (slot-boundp instance 'traced-slots)
	     (not (null (traced-slots instance)))
	     (member (mopp:slot-definition-name slot-def) (traced-slots instance)))
     ;;;; i've tried to call refresh-component here but it seems it
     ;;;; impossible to use it. -evrim.

     ;;;; let's queue this as dirty.
     (when (not (member instance (context.dirty-components *context*)))
       (pushnew instance (context.dirty-components *context*)))))





More information about the bese-devel mailing list