On Wed, Mar 26, 2008 at 1:57 AM, Ken Tilton kennytilton@optonline.net wrote:
Andy,
Food for thought: I just noticed a recent email from Peter Hildebrandt who had likewise wished he had time to do what you are doing. Peter struck me as very solid (as do you <g>). Sounds like things are going well for you, so you might mention Hunchncells on cells-devel or even c.l.lisp when you are ready for company, or we could just try Peter and/or Edi Weitz directly.
I thought I had but looking back, it does seem that some of these exchanges have been sent directly to you Kenny. Sorry about that, I didn't mean to exclude anyone.
So for the list....
I've picked off some of the low-hanging fruit in an effort to make hunchentoot handlers cells-aware. Most of the code so far has just been doing the equivalent of deftk but creating "html" widgets instead of tk ones.
http://gitorious.org/projects/hunchncells
The way this will work I think is as follows:- (most of this is vaporware)
1) request comes in from hunchentoot 2) cells handler gets "root" family object from hunchentoot session (or creates a fresh one) 3) kick off the propagation by setf'ing the request slot on root 4) an initial response is created from the xhtml slot of the root ...user does something on the browser end... 5) make ajax call to updates service 6) the update handler feeds some new paramaters into the model 5) observers on .kids, and .value log changes into an updates slot on the root 6) the updates are sent back down to the client
The updates would be a list of strings representing updates to the DOM. When it gets to the client, it is simply eval'd and hopefully, the page reflects the new state.
Here's some other stuff I've been thinking about.
1) In celtk, it seems like pretty much all events are sent from tk to cells for handling by the widget-event-handle. I think that doing the same for javascript events would be too expensive. Perhaps we could classify events into those that need to be sent immediately, those that can be sent periodically (say every 5 seconds), and those that can be ignored. I think even this would be probably not be scalable but I don't work for google so I don't have to worry about that ;-).
2) How do we feed these javascript events into the model? This would probably be another handler on a different url that listens for events specified as ajax GETs like this...
GET /events?event=change&id=I034&new=somevalue
It feeds these onto an events slot on the model and returns the current value of the updates slot mentioned above to the client
-- Andy
Andy Chambers wrote:
I've picked off some of the low-hanging fruit in an effort to make hunchentoot handlers cells-aware. Most of the code so far has just been doing the equivalent of deftk but creating "html" widgets instead of tk ones.
http://gitorious.org/projects/hunchncells
The way this will work I think is as follows:- (most of this is vaporware)
- request comes in from hunchentoot
- cells handler gets "root" family object from hunchentoot session
(or creates a fresh one) 3) kick off the propagation by setf'ing the request slot on root 4) an initial response is created from the xhtml slot of the root ...user does something on the browser end... 5) make ajax call to updates service 6) the update handler feeds some new paramaters into the model 5) observers on .kids, and .value log changes into an updates slot on the root 6) the updates are sent back down to the client
Sounds good, tho of course the devil is in the details and I am new to all this interwebby stuff.
Food for thought if it comes up: Cells3 introduced a mechanism whereby observers could queue their output to a client-queue and likewise specify a client queue handler for those cases where custom handling is required. Tk, eg, is a little fussy about the order in which things happen, so observers (who do most of the talking to tk) rather than talking directly to tcl/tk had to queue up their actions along with a keyword used by a tk-specific client-q handler to sort things into the right order.
eg, if you are introducing a new node to the dom in one place and referencing it in another, mebbe you have to make sure those bits go to the browser in that order (create before reference) and you'll need to borrow that bit as well from Celtk.
The updates would be a list of strings representing updates to the DOM. When it gets to the client, it is simply eval'd and hopefully, the page reflects the new state.
Flapjax, OpenLaszlo move over! :)
Here's some other stuff I've been thinking about.
- In celtk, it seems like pretty much all events are sent from tk to
cells for handling by the widget-event-handle. I think that doing the same for javascript events would be too expensive.
Right, Celtk uses the C FFI so we can pin our ears back and go, LTk does not have that much performance hence access to the event stream.
Perhaps we could classify events into those that need to be sent immediately, those that can be sent periodically (say every 5 seconds), and those that can be ignored. I think even this would be probably not be scalable but I don't work for google so I don't have to worry about that ;-).
- How do we feed these javascript events into the model? This would
probably be another handler on a different url that listens for events specified as ajax GETs like this...
GET /events?event=change&id=I034&new=somevalue It feeds these onto an events slot on the model and returns the
current value of the updates slot mentioned above to the client
I am afraid it's all Greek to me, but if you really need the input lemme know and you can bring me up to speed on the technology.
If this is at all relevant, I have always anticipated a Cells.js support module to make it all go.
kt
ps. I am tempted to mention all this on comp.lang.lisp, mebbe scare up some more interested parties. k
This just bit me (the default initarg):
(defmodel family (model) ((.kid-slots :cell nil :initform nil :accessor kid-slots :initarg :kid-slots) (.kids :initform (c-in nil) ;; most useful :owning t :accessor kids :initarg :kids) ) (:default-initargs :fm-parent (when (boundp '*parent*) *parent*)))
I do not show that in any Cells backup other than one taken last night, but CVS shows no updates by anyone but me recently.
Did I add that?! If not, I understand the motivation but it won't work, given that dynamic variables are just "out there" which is great when that is what we want but otherwise not so much, things meant to have a nil parent suddenly pick one up.
fixing now.
kt
Am 27.03.2008 um 00:48 schrieb Ken Tilton:
This just bit me (the default initarg):
(defmodel family (model) ((.kid-slots :cell nil :initform nil :accessor kid-slots :initarg :kid-slots) (.kids :initform (c-in nil) ;; most useful :owning t :accessor kids :initarg :kids) ) (:default-initargs :fm-parent (when (boundp '*parent*) *parent*)))
I do not show that in any Cells backup other than one taken last night, but CVS shows no updates by anyone but me recently.
Did I add that?! If not, I understand the motivation but it won't work, given that dynamic variables are just "out there" which is great when that is what we want but otherwise not so much, things meant to have a nil parent suddenly pick one up.
fixing now.
kt
Pleading "Not Guilty" - I didn't do it ;-)
Frank
Frank Goenninger wrote:
Am 27.03.2008 um 00:48 schrieb Ken Tilton:
This just bit me (the default initarg):
(defmodel family (model) ((.kid-slots :cell nil :initform nil :accessor kid-slots :initarg :kid-slots) (.kids :initform (c-in nil) ;; most useful :owning t :accessor kids :initarg :kids) ) (:default-initargs :fm-parent (when (boundp '*parent*) *parent*)))
I do not show that in any Cells backup other than one taken last night, but CVS shows no updates by anyone but me recently.
Did I add that?! If not, I understand the motivation but it won't work, given that dynamic variables are just "out there" which is great when that is what we want but otherwise not so much, things meant to have a nil parent suddenly pick one up.
fixing now.
kt
Pleading "Not Guilty" - I didn't do it ;-)
I wonder if this snuck in when I commited from the wrong directory. It /does/ seem like something I would have tried at some point. And that would explain the CVS history just showing me.
kt
Mea culpa! I don't know why CVS does not show my comment, but it was me who tried that at some point.
It must have been from before you introduced kids-list?. So feel free to remove it ASAP.
I am just catching up with things. I have been out of the country (that is, out of Germany) for the past ten days and just got back yesterday.
OT: Thanks for mentioning me in the Hunchocells thread. However, even though I believe this is a very promising (and fun) project, I am afraid I won't have the time to make any substantial contributions. My priorities are (in order) getting the cairo drawaing in cells-gtk up to speed, adding opengl to cells-gtk, and bundling up cells-ode-gl-gtk (we need a new name!)
Peter
Ken Tilton wrote:
Frank Goenninger wrote:
Am 27.03.2008 um 00:48 schrieb Ken Tilton:
This just bit me (the default initarg):
(defmodel family (model) ((.kid-slots :cell nil :initform nil :accessor kid-slots :initarg :kid-slots) (.kids :initform (c-in nil) ;; most useful :owning t :accessor kids :initarg :kids) ) (:default-initargs :fm-parent (when (boundp '*parent*) *parent*)))
I do not show that in any Cells backup other than one taken last night, but CVS shows no updates by anyone but me recently.
Did I add that?! If not, I understand the motivation but it won't work, given that dynamic variables are just "out there" which is great when that is what we want but otherwise not so much, things meant to have a nil parent suddenly pick one up.
fixing now.
kt
Pleading "Not Guilty" - I didn't do it ;-)
I wonder if this snuck in when I commited from the wrong directory. It /does/ seem like something I would have tried at some point. And that would explain the CVS history just showing me.
kt _______________________________________________ cells-devel site list cells-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cells-devel
Peter Hildebrandt wrote:
Mea culpa! I don't know why CVS does not show my comment, but it was me who tried that at some point.
Cool. What happened was a math problem has a non-kids slot for a solution, which is a tree of possible paths to an answer, aka a family subclass. the top solution node is meant to have no parent. children nodes search up the tree to calculate the total cost of their path.
The solution was for a problem embedded in a view and the solution tree expansion got kicked off while the problem view was growing, so the top-level solution mysteriously picked up the row widget (bound to *parent*) as parent because of the default-initarg (itself a diabolical trick picking up a special variable value, never saw that one before. (And that is the great thing about powerful tools, people always find new ways to use them.)
OT: Thanks for mentioning me in the Hunchocells thread. However, even though I believe this is a very promising (and fun) project, I am afraid I won't have the time to make any substantial contributions.
Well, any ideas you can throw over the wall as the traffic sails by will be welcome.
kt