[ooops--for the list]
-------- Original Message -------- Subject: Re: [cells-devel] observer design question Date: Fri, 28 Mar 2008 10:44:15 -0400 From: Ken Tilton kennytilton@optonline.net Organization: Theory Y Learning To: achambers.home@gmail.com References: a70cc98c0803280617n161f774ek466efe371228d2bb@mail.gmail.com 47ECF307.5000704@optonline.net a70cc98c0803280730t27003f4dgbf5bc8d2fc22dbf2@mail.gmail.com
Andy Chambers wrote:
On Fri, Mar 28, 2008 at 1:30 PM, Ken Tilton kennytilton@optonline.net wrote:
Andy Chambers wrote:
My model consists of a family tree of objects all of which have an xhtml ruled cell. The client needs to be updated if the value of this slot has changed. However, a change in one would cascade up the tree so if we were logging these changes, and sending them down to the client, one of the things we send would be the entire document which is not what we want.
How did the entire document change (I mean in /precisely/ what way such that your app wanted to send the whole thing?
The xhtml rule (for an html div) looks almost like this (in the real one there's a line to put the attributes in too).
(c? (with-output-to-string (s) (with-html-output (s) (:div (str (apply #'concatenate 'string (mapcar #'xhtml (^kids))))))))
So the value of it depends on its kids. If any of the kids change, then the xhtml slot on the div object will also change. If I was to put an observer on xhtml, it would fire all the way up the tree from each leaf that changed wouldn't it?
Yes. This is cool, this is like OpenGL display lists which are like objects in that my parent does not need to be rebuilt on the OpenGL side just because I have changed, my parent display list just runs and when it calls me -- well, it is more like Lisp with changing a function defintition while the application is running, my new display instructions get executed.
So what I am hearing between the lines is that the kid can change and push itself over to the DOM (if I have the jargon right) and the browser will Do the Right Thing in re getting everything rendered?
Get back to me to confirm, meanwhile I will refresh on the sleight of hand I did to make display lists work. IIRC the trick will be to have each rule turn off dependency tracking, sample each kid to get them up to date, then turn dependency back on for the /assembly/ of the kids into the current xhtml result.
kt