From achambers.home at googlemail.com Wed Mar 12 20:29:24 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 12 Mar 2008 20:29:24 +0000 Subject: [cells-devel] celtk cleaning - slot-value-observe Message-ID: Hi Kenny, So I'm cleaning up my celtk stuff so I've got a list of wee things that cause problems when asdf installing it that I'll submit patches for over the next few days. Here's the first... slot-value-observe seems to take an extra parameter now so I've adjusted my version to the following. Is this ok to be checked in? (defmethod slot-value-observe progn (slot-name (self tk-object) new-value old-value old-value-boundp cell) (declare (ignorable old-value cell)) (when old-value-boundp ;; initial propagation to Tk happens during make-tk-instance (bwhen (tco (tk-config-option self slot-name)) ;; (get slot-name 'tk-config-option)) (tk-configure self (string tco) (or new-value ""))))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From achambers.home at googlemail.com Wed Mar 12 20:32:00 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 12 Mar 2008 20:32:00 +0000 Subject: [cells-devel] celtk cleaning - foreign libraries Message-ID: I modified the foreign library packages as follows to make it work on my machine. In a previous email, someone said it worked best (at least for cello) with tcl 8.5 so we might as well make that explicit on unix. (define-foreign-library Tcl (:darwin (:framework "Tcl")) (:windows (:or "Tcl85.dll")) (:unix (:or "libtcl8.5.so" "libtcl.so")) (t (:default "libtcl"))) (define-foreign-library Tk (:darwin (:framework "Tk")) (:windows (:or "Tk85.dll")) (:unix (:or "libtk8.5.so" "libtk.so")) (t (:default "libtk"))) (define-foreign-library Tile ;(:darwin (:framework "Tk")) (:windows (:or "tile078.dll")) (:unix (:or "libtk8.5.so" "libtk.so")) (t (:default "libtk"))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From achambers.home at googlemail.com Wed Mar 12 20:36:59 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 12 Mar 2008 20:36:59 +0000 Subject: [cells-devel] celtk cleaning - cg package Message-ID: For those of us unfortunate enough to be doing lisp for free ;-) ..in run.lisp (run-window) #+allegro (CG:kill-splash-screen) I'm assuming here that cg is only found on allegro. Is that the case? -------------- next part -------------- An HTML attachment was scrubbed... URL: From qerm at common-lisp.net Sat Mar 15 08:11:02 2008 From: qerm at common-lisp.net (Angelica) Date: Sat, 15 Mar 2008 08:11:02 -0000 Subject: [cells-devel] RE:software market Message-ID: <47DB8496.8070908@common-lisp.net> An HTML attachment was scrubbed... URL: From achambers.home at googlemail.com Sat Mar 15 10:39:33 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Sat, 15 Mar 2008 10:39:33 +0000 Subject: [cells-devel] Newbie Friendly Fork of celtk Message-ID: Hi all, I've created a project for celtk development on repo.or.cz I'll keep the master branch as a mirror of the celtk in cells (I'll try to work out a way to automate this so it doesn't get out of sync). I've added another branch (linux) and committed the changes I sent a few days ago. The intention is that folks here just continue to work as they do. I take any changes and forward them (in an asdf-friendly way if applicable) to the git repo. Maybe I'll even add some function documentation. Its very much an experiment. I'm pretty new to git and getting a bit more familiar with celtk but I'd still say I'm a little wet behind the ears. Hopefully I can make it friendly enough that a few others will jump in and help me out. -- Andy Chambers -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennytilton at optonline.net Sat Mar 15 11:06:40 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Sat, 15 Mar 2008 07:06:40 -0400 Subject: [cells-devel] Newbie Friendly Fork of celtk In-Reply-To: References: Message-ID: <47DBADC0.6040209@optonline.net> Andy Chambers wrote: > Hi all, > > I've created a project for celtk development on > > repo.or.cz > > I'll keep the master branch as a mirror of the celtk in cells (I'll try > to work out a way to automate this so it doesn't get out of sync). I've > added another branch (linux) and committed the changes I sent a few days > ago. > > The intention is that folks here just continue to work as they do. I > take any changes and forward them (in an asdf-friendly way if > applicable) to the git repo. Maybe I'll even add some function > documentation. > > Its very much an experiment. I'm pretty new to git and getting a bit > more familiar with celtk but I'd still say I'm a little wet behind the > ears. Hopefully I can make it friendly enough that a few others will > jump in and help me out. Cool. But on the repo it says "Linux/SBCL Friendly". Is that literally true? An OS/Lisp implementation-specific fork of a portable GUI? Hmmm... :) kenny From kennytilton at optonline.net Sat Mar 15 11:21:35 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Sat, 15 Mar 2008 07:21:35 -0400 Subject: [cells-devel] Newbie Friendly Fork of celtk In-Reply-To: <47DBADC0.6040209@optonline.net> References: <47DBADC0.6040209@optonline.net> Message-ID: <47DBB13F.6080904@optonline.net> Ken Tilton wrote: > Andy Chambers wrote: > >> Hi all, >> >> I've created a project for celtk development on >> >> repo.or.cz >> >> I'll keep the master branch as a mirror of the celtk in cells (I'll >> try to work out a way to automate this so it doesn't get out of >> sync). I've added another branch (linux) and committed the changes I >> sent a few days ago. >> >> The intention is that folks here just continue to work as they do. I >> take any changes and forward them (in an asdf-friendly way if >> applicable) to the git repo. Maybe I'll even add some function >> documentation. >> >> Its very much an experiment. I'm pretty new to git and getting a bit >> more familiar with celtk but I'd still say I'm a little wet behind the >> ears. Hopefully I can make it friendly enough that a few others will >> jump in and help me out. > > > Cool. But on the repo it says "Linux/SBCL Friendly". Is that literally > true? An OS/Lisp implementation-specific fork of a portable GUI? > > Hmmm... :) Perhaps I should offer more than Om. :) A number of people have threatened to do what Peter Denno did for Cells-Gtk and fire up a standalone Celtk project (or maybe he accepted ownership of the project after I started it -- yes, I think so). If enough (or one energetic) of those remain perhaps it is time? Then you could merge your patches with the main version and keep moving towards the light (a portable Lisp GUI). I would continue committing anything I do to Celtk under the Cells repository, mainly because I am too frazzled now to worry about keeping Algebra stuff out of other libraries. kenny From achambers.home at googlemail.com Sat Mar 15 16:06:46 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Sat, 15 Mar 2008 16:06:46 +0000 Subject: [cells-devel] False Start Message-ID: So that last one was a false start. After reading a little bit more about git and how it plays with cvs, I managed to create another project that keeps all the existing history and puts a nice user interface on it. The gitorious hosting seems a little more polished and a bit more newbie friendly (as befits a newbie friendly project). I would have used that one first had I known about it but only came accross it when looking for more info. Here's the url... http://gitorious.org/projects/celtk Kenny, you get the prize for the best commit / commit message ratio :-) -- Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennytilton at optonline.net Sat Mar 15 19:44:59 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Sat, 15 Mar 2008 15:44:59 -0400 Subject: [cells-devel] False Start In-Reply-To: References: Message-ID: <47DC273B.70601@optonline.net> Andy Chambers wrote: > Kenny, you get the prize for the best commit / commit message ratio :-) Careful, I have a reputation to maintain. :) kenny From achambers.home at googlemail.com Mon Mar 17 20:00:07 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 17 Mar 2008 20:00:07 +0000 Subject: [cells-devel] expander reinvigorated Message-ID: Hi Kenny, I never quite finished that expander stuff when I was doing it before. I ran into difficulties with the up/down icons but I think I know how to fix that now. However there seems to be another problem. If you try evaluate the test-window form at the bottom, every second time, you get "Tcl Error: out of stack space". I think there must be something that needs to be destroyed somewhere but none of the other composite widgets seem to have to do that. Any ideas? (defmodel expander (frame-stack) ((label :initarg :label :accessor label :initform (c-in nil)) (expansion :initarg :expansion :accessor expansion :initform nil) (expanded :initarg :expanded :accessor expanded :initform (c-in nil))) (:default-initargs :fm-parent (error "expander widget must have some kind of parent"))) (defmacro mk-expander ((&rest inits) &body body) `(make-instance 'expander , at inits :fm-parent *parent* :expansion (c? (the-kids , at body)) :expanded (c-in t) :kids (c? (the-kids (mk-button-ex ((^label) (setf (expanded (upper self expander)) (not (expanded (upper self expander)))))) (^expansion))) :kids-packing (c? (when (^kids) (if (^expanded) (format nil "pack~{ ~a~} -side top -anchor nw -padx ~a -pady ~a" (mapcar 'path (^kids)) (^padx) (^pady)) (format nil "pack forget~{ ~a~}" (mapcar 'path (cdr (^kids))))))))) (defmodel expander-test (window) () (:default-initargs :kids (c? (the-kids (mk-stack (:packing (c?pack-self)) (mk-expander (:label "hi") (mk-label :text "hi") (mk-label :text "ho"))))))) (test-window 'expander-test) From achambers.home at googlemail.com Mon Mar 17 22:59:19 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 17 Mar 2008 22:59:19 +0000 Subject: [cells-devel] observers Message-ID: Two questions... 1) What's the best way to remove an observer that's been set on some slot? 2) If there's an observer like (defobserver image-files ((self widget)) (loop for (name file-pathname) in (set-difference new-value old-value :key 'car) do (tk-format `(:pre-make-tk ,self) "image create photo ~(~a.~a~) -file {~a} -height ~a -width ~a" (^path) name (namestring file-pathname) (^height)(^width)))) ....can I make one that specializes on a subclass of widget that overrides the first? How does one do this? -- Andy From kennytilton at optonline.net Tue Mar 18 00:26:45 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Mon, 17 Mar 2008 20:26:45 -0400 Subject: [cells-devel] observers In-Reply-To: References: Message-ID: <47DF0C45.7090203@optonline.net> Andy Chambers wrote: > Two questions... > > 1) What's the best way to remove an observer that's been set on some slot? My ide offers a gui display of all methods on a GF, in this case the gf being slot-value-observe. If I am feeling energetic I use that to hunt down the specific method and then (using the same gui) remove the method. If I am not feeling energetic I delete the body of the one I want to lose, recompile so it still runs but does nothing, then delete altogether so on the next load from scratch it is fully gone. > > 2) If there's an observer like > > (defobserver image-files ((self widget)) > (loop for (name file-pathname) in (set-difference new-value > old-value :key 'car) > do (tk-format `(:pre-make-tk ,self) > "image create photo ~(~a.~a~) -file {~a} -height ~a -width ~a" > (^path) name (namestring file-pathname) > (^height)(^width)))) > > ....can I make one that specializes on a subclass of widget that > overrides the first? How does one do this? No. Observers are progn in any lisp that supports progn method combination. To get the desired effect, have one observer redispatch to another GF (perhaps observe-widget-image-files) and then use classic method combo for that and tailor functionality the old-fashioned way. kenny From achambers.home at googlemail.com Thu Mar 20 20:35:27 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Thu, 20 Mar 2008 20:35:27 +0000 Subject: [cells-devel] expander copyright stuff Message-ID: Hey Kenny, At the moment, each file in celtk has a license header as printed below. I'd like to put my name somewhere on the file for expander.lisp but am not sure if it is correct to simply replace your name with mine since then if someone only looked at that file, it looks like I did the whole thing. May I suggest that I just put an additional line under the existing copyright one that says something like Copyright (C) 2008 by Andy Chambers Cheers, Andy #| Celtk -- Cells, Tcl, and Tk Copyright (C) 2006 by Kenny Tilton This library is free software; you can redistribute it and/or modify it under the terms of the Lisp Lesser GNU Public License (http://opensource.franz.com/preamble.html), known as the LLGPL. This library is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lisp Lesser GNU Public License for more details. |# From p at common-lisp.net Thu Mar 20 23:43:56 2008 From: p at common-lisp.net (Lloyd) Date: Fri, 21 Mar 2008 00:43:56 +0100 Subject: [cells-devel] Obtain PhD that you deserve from an Established Prestigious Institution. Message-ID: <47E2F6BC.80500@common-lisp.net> F A S T T R A C K D E G R E E P R O G R A M Obtain the degree you deserve, based on your present knowledge and life experience. A prosperous future, money earning power, and the Admiration of all. Degrees from an Established, Prestigious, Leading Institution. Your Degree will show exactly what you really can do. Get the Job, Promotion, Business Opportunity and Social Advancement you Desire! Eliminates classrooms and traveling. Achieve your Bachelors, Masters, MBA, or PhD in the field of your expertise Professional and affordable Call now - your Graduation is a phone call away. Please call: +1 206 30 90 336 From achambers.home at googlemail.com Sat Mar 22 18:26:21 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Sat, 22 Mar 2008 18:26:21 +0000 Subject: [cells-devel] tile slot Message-ID: Hi, Are you supposed to be able to use the tile? slot to determine whether a tile widget is used? I've been trying to convert some of the demos distributed with tk itself to celtk but because the tile widgets are used by default, you can't set any style properties. I tried the code below but cells thinks the relief slot needs a parent. I get the error.... "New as of Cells3: parent must be supplied to make-instance of KEYWORD kid RELIEF" (defmodel tk-labels (window) () (:default-initargs :title$ "Label Demonstration" :kids (c? (the-kids (mk-stack (:packing (c?pack-self "-side top")) (mk-label :wraplength "4i" :tk-justify 'left :text (concatenate 'string "Five labels are displayed below: three textual ones on the left and a bitmap" "label and a text label on the right. Labels are pretty boring " "because you can't do anything with them.")) (mk-row () (mk-stack (:pady 2 :layout-anchor 'w) (mk-label :text "First Label") (mk-label :tile? nil) :relief (c? 'raised) :text "Second Label, raised" (mk-label :tile? nil :text "Third Label, sunken" :relief (c? 'sunken))))))))) Am I going about this the wrong way? Another problem I'm having is to do with packing. Are you really supposed to be able to express the layout of a whole app with just one pack statement? I'd like to have a panel of expander widgets each of which is packed so that it fills on the x-axis. I expect that other panels would probably have different packing requirements but if you put more than one (c?pack-self ...) in an app, you get an error saying "don't specify packing here. Cheers, Andy From kennytilton at optonline.net Sat Mar 22 19:38:07 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Sat, 22 Mar 2008 15:38:07 -0400 Subject: [cells-devel] tile slot In-Reply-To: References: Message-ID: <47E5601F.7030406@optonline.net> Andy Chambers wrote: > Hi, > > Are you supposed to be able to use the tile? slot to determine whether > a tile widget is used? Ugh, I honestly do not recall. I think setting that to t /tells/ celtk to use tile. I know I tested tile on win32, seemed OK. > > I've been trying to convert some of the demos distributed with tk > itself to celtk but because > the tile widgets are used by default, you can't set any style properties. > > I tried the code below but cells thinks the relief slot needs a > parent. I get the error.... > > "New as of Cells3: parent must be supplied to make-instance of KEYWORD > kid RELIEF" That is different, you just have to check all the macrology to make sure the :parent slot is picked up from *parent* or self or something, > > (defmodel tk-labels (window) > () > (:default-initargs > :title$ "Label Demonstration" > :kids (c? (the-kids > (mk-stack (:packing (c?pack-self "-side top")) > (mk-label :wraplength "4i" > :tk-justify 'left > :text (concatenate 'string > "Five labels are displayed below: three textual ones on the left and a bitmap" > "label and a text label on the right. Labels are pretty boring " > "because you can't do anything with them.")) > (mk-row () > (mk-stack (:pady 2 > :layout-anchor 'w) > (mk-label :text "First Label") > (mk-label :tile? nil) > :relief (c? 'raised) > :text "Second Label, raised" > > (mk-label :tile? nil > :text "Third Label, sunken" > :relief (c? 'sunken))))))))) > > Am I going about this the wrong way? > > Another problem I'm having is to do with packing. Are you really > supposed to be able to > express the layout of a whole app with just one pack statement? I think rows and stacks supply useful packing by default which one overrirdes at will. kenny From frgo at mac.com Sun Mar 23 10:33:56 2008 From: frgo at mac.com (Frank Goenninger) Date: Sun, 23 Mar 2008 11:33:56 +0100 Subject: [cells-devel] tile slot In-Reply-To: <47E5601F.7030406@optonline.net> References: <47E5601F.7030406@optonline.net> Message-ID: <051C8135-BE3A-41D6-BA23-DBF9844EF568@mac.com> Am 22.03.2008 um 20:38 schrieb Ken Tilton: > Andy Chambers wrote: >> Hi, >> Are you supposed to be able to use the tile? slot to determine >> whether >> a tile widget is used? > > Ugh, I honestly do not recall. I think setting that to t /tells/ > celtk to use tile. Yes, that's how it is used. Some widgets do have slots and/or behavior that are only avaliable when Tile is used/loaded. > I know I tested tile on win32, seemed OK. Mac OS X had problems with it a while back (Tile wasn't working with Tk 8.5 on OSX back then). I don't know what the status is today, though, as I still don't use Tile. >> I've been trying to convert some of the demos distributed with tk >> itself to celtk but because >> the tile widgets are used by default, you can't set any style >> properties. >> I tried the code below but cells thinks the relief slot needs a >> parent. I get the error.... >> "New as of Cells3: parent must be supplied to make-instance of >> KEYWORD >> kid RELIEF" > > That is different, you just have to check all the macrology to make > sure the :parent slot is picked up from *parent* or self or something, Yep. So all those mk- macros have to be enhanced to include ":fm- parent *parent*" in their definitions. >> (defmodel tk-labels (window) >> () >> (:default-initargs >> :title$ "Label Demonstration" >> :kids (c? (the-kids >> (mk-stack (:packing (c?pack-self "-side top")) >> (mk-label :wraplength "4i" >> :tk-justify 'left >> :text (concatenate 'string >> "Five labels are displayed below: three textual ones on the left >> and a bitmap" >> "label and a text label on the right. Labels are pretty boring " >> "because you can't do anything with them.")) >> (mk-row () >> (mk-stack (:pady 2 >> :layout-anchor 'w) >> (mk-label :text "First Label") >> (mk-label :tile? nil) >> :relief (c? 'raised) >> :text "Second Label, raised" >> (mk-label :tile? nil >> :text "Third Label, sunken" >> :relief (c? 'sunken))))))))) >> Am I going about this the wrong way? >> Another problem I'm having is to do with packing. Are you really >> supposed to be able to >> express the layout of a whole app with just one pack statement? > > I think rows and stacks supply useful packing by default which one > overrirdes at will. Yep. They do. (defmodel tk-labels (window) () (:default-initargs :title$ "Label Demonstration" :kids (c? (the-kids (mk-stack (:packing (c?pack-self "-side top")) (mk-label :wraplength "4i" :tk-justify 'left :text (concatenate 'string "Five labels are displayed below: three textual ones on the left and a bitmap" "label and a text label on the right. Labels are pretty boring " "because you can't do anything with them.")) (mk-row () (mk-stack (:pady 2 ;; Not sure about this :layout-anchor 'w) ;; I always use explicit placing (mk-label :text "First Label") (mk-label :relief 'raised :text "Second Label, raised") (mk-label :text "Third Label, sunken" :relief 'sunken)))))))) ... this should do it (warning: untested). Cheers! Frank From kennytilton at optonline.net Sun Mar 23 17:04:00 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Sun, 23 Mar 2008 13:04:00 -0400 Subject: [cells-devel] tile slot In-Reply-To: <051C8135-BE3A-41D6-BA23-DBF9844EF568@mac.com> References: <47E5601F.7030406@optonline.net> <051C8135-BE3A-41D6-BA23-DBF9844EF568@mac.com> Message-ID: <47E68D80.4050304@optonline.net> Frank Goenninger wrote: > Yep. So all those mk- macros have to be enhanced to include ":fm- parent > *parent*" in their definitions. Hmmm, my code base already has that. And it also had dependencies on Cello (those cl-ftgl package refs and others). I just updated against FGs updates today and tho it said I had to resolve run.lisp I found no problem. :( Anyway, I am about to commit my Celtk directory (with the working mk-* / parent stuff) so we may be in for a day or two of fun. kt From frgo at mac.com Sun Mar 23 19:01:46 2008 From: frgo at mac.com (Frank Goenninger) Date: Sun, 23 Mar 2008 20:01:46 +0100 Subject: [cells-devel] tile slot In-Reply-To: <47E68D80.4050304@optonline.net> References: <47E5601F.7030406@optonline.net> <051C8135-BE3A-41D6-BA23-DBF9844EF568@mac.com> <47E68D80.4050304@optonline.net> Message-ID: Am 23.03.2008 um 18:04 schrieb Ken Tilton: > Frank Goenninger wrote: > >> Yep. So all those mk- macros have to be enhanced to include ":fm- >> parent *parent*" in their definitions. > > Hmmm, my code base already has that. And it also had dependencies on > Cello (those cl-ftgl package refs and others). Oh, yeah - the CVS already has that. I did want to imply that the code in CVS needs to be changed. I had to change *my* code when going from Cells2 to Cells3. > > > I just updated against FGs updates today and tho it said I had to > resolve run.lisp I found no problem. :( No problem and ":(" ? > > > Anyway, I am about to commit my Celtk directory (with the working mk- > * / parent stuff) so we may be in for a day or two of fun. Looking forward to it. ;-) Frank From frgo at mac.com Sun Mar 23 19:03:35 2008 From: frgo at mac.com (Frank Goenninger) Date: Sun, 23 Mar 2008 20:03:35 +0100 Subject: [cells-devel] tile slot In-Reply-To: References: <47E5601F.7030406@optonline.net> <051C8135-BE3A-41D6-BA23-DBF9844EF568@mac.com> <47E68D80.4050304@optonline.net> Message-ID: <1140B4E5-1BB5-40DE-9C38-1754A91E46BB@mac.com> Am 23.03.2008 um 20:01 schrieb Frank Goenninger: > > Am 23.03.2008 um 18:04 schrieb Ken Tilton: >> Frank Goenninger wrote: >> >>> Yep. So all those mk- macros have to be enhanced to include ":fm- >>> parent *parent*" in their definitions. >> >> Hmmm, my code base already has that. And it also had dependencies >> on Cello (those cl-ftgl package refs and others). > > Oh, yeah - the CVS already has that. I did want to imply that the > code in CVS needs to be changed. .. did *not* want to ... Sigh. Frank From achambers.home at googlemail.com Tue Mar 25 17:19:23 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Tue, 25 Mar 2008 17:19:23 +0000 Subject: [cells-devel] family hierarchies Message-ID: Does it cause problems if a family is defined on a slot different from kids? I ask because in a webified cells, you'd probably want to define the model on a :page slot or something. (defmodel web-app (family) ((page ...) (request ...) (:default-initargs :page (c? (the-kids ....))) I've made a few macros based on those in celtk that use cl-who to populate an xhtml slot. The families are building up quite nicely now. I am having one problem though. The web pages are constructed using macros like this... (mk-page (:titile "some page") (mk-div () (mk-text "hello world"))) I created a definehtml macro to make a defmodel and a corresponding mk- macro for a few of the commonly used html elements (I'll do the others as and when required). What I'm not sure about is the mk-text for simple strings. On the plus side, I can use a rule to escape special characters like & et el. Another plus is that we can put all text inside addressable span elements so if only that bit of text updates, we can send the appropriate bit of javascript down to the client that pin-points the change we want. Here's roughly how one of the mk- macros look at the moment. (defmacro mk-div ((&rest inits) &body body) `(make-instance 'div , at inits :fm-parent *parent* :kids (c? (the-kids ,@(loop for kid in body when (stringp kid) collect (mk-text kid) else collect kid)))))) ;; not sure about the parens here, I edited a bit in email What I'd really like is to examine the type of each form in body to see if its a string. If so, use the mk-text macro to make that string into a family object. What you see above does do that but it doesn't pick up the *parent*, presumably because the macroexpansion of the mk-text bit happens before *parent* has been evaluated. Maybe the easiest thing would just be to use a really short name for the mk-text macro and be done with it. Cheers, Andy From kennytilton at optonline.net Tue Mar 25 17:40:14 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Tue, 25 Mar 2008 13:40:14 -0400 Subject: [cells-devel] family hierarchies In-Reply-To: References: Message-ID: <47E938FE.4030108@optonline.net> Andy Chambers wrote: > Does it cause problems if a family is defined on a slot different from kids? Yes and no. No because I generalized kids behavior so you now say (as you can see in the family class on the .kids slot) ":owning t"), yes because you might be the first to use :owning in anger on a non-.kids slot and thus you will be the guinea pig to find any places still hard-coded to look specifically for .kids, or some other code that makes it all work but only for kids. So go for it but ping me right away if something goes wrong. > > I ask because in a webified cells, you'd probably want to define the > model on a :page slot or something. > > (defmodel web-app (family) > ((page ...) > (request ...) > (:default-initargs > :page (c? (the-kids ....))) > > I've made a few macros based on those in celtk that use cl-who to > populate an xhtml slot. The families > are building up quite nicely now. I am having one problem though. > The web pages are constructed using > macros like this... > > (mk-page (:titile "some page") > (mk-div () > (mk-text "hello world"))) > > > I created a definehtml macro to make a defmodel and a corresponding > mk- macro for a few of the commonly > used html elements (I'll do the others as and when required). Sounds good. If you have either Celtk or Cells-GTk running (or just care to look at the source for key macrology such as DEFTK or some such that does the moral equivalent of what you are doing) you will see how these layers talk to Tk/Gtk to get objects built in their worlds from objects built in the Lisp world. I think you are doing the same thing. > What > I'm not sure about is the mk-text for > simple strings. On the plus side, I can use a rule to escape special > characters like & et el. Another plus > is that we can put all text inside addressable span elements so if > only that bit of text updates, we can > send the appropriate bit of javascript down to the client that > pin-points the change we want. > > Here's roughly how one of the mk- macros look at the moment. > > (defmacro mk-div ((&rest inits) &body body) > `(make-instance > 'div > , at inits > :fm-parent *parent* > :kids (c? (the-kids > ,@(loop for kid in body > when (stringp kid) > collect (mk-text kid) > else > collect kid)))))) ;; not sure about the parens here, I edited > a bit in email Do you really mean to detect strings only at compile time (which would be OK, I am just trying to get this clear) or also at run time? Anyway, the macrology looks odd. I am expecting: (defmacro mk-div ((&rest inits) &body body) `(make-instance 'div , at inits :fm-parent *parent* :kids (c? (the-kids ,@(loop for kid in body when (stringp kid) collect `(mk-text ,kid) ;; <---- backquote else collect kid)))))) ie, you are collecting MK forms, not actual made instances. Then (I read ahead some) as long as your mk-text macro adds code to capture *fm-parent* or whatever it is you will be ok. > > What I'd really like is to examine the type of each form in body to > see if its a string. If so, use the mk-text > macro to make that string into a family object. ? Did you mean "a family member"? I say that based on the next bit > What you see above > does do that but it doesn't pick up the > *parent*, presumably because the macroexpansion of the mk-text bit > happens before *parent* has been > evaluated. I guess I am top-posting. :) But I think the only problem is you left out a backquote. > Maybe the easiest thing would just be to use a really > short name for the mk-text macro and be > done with it. ??? Well, let's sort out the other stuff, it might be nothing but a little work on that loop. btw, loop is funny on how it mutates its iteration variables, I sometimes end up writing: (let ((kid kid)) `(mk-text ,kid)) ...in cases like this. peace,k From achambers.home at googlemail.com Wed Mar 26 00:01:48 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 26 Mar 2008 00:01:48 +0000 Subject: [cells-devel] eval-now (utils-kt) Message-ID: Is all that export! and eval-now! stuff a convenience for your ide or is it something you invented to make sure your code gets loaded/compiled in the right order? I ask because I'm trying to make what I've done so far at least asdf-loadable. There's some code up at gitorious (http://gitorious.org/projects/hunchncells) if you have a git available. If not, and you'd like a copy, I can zip it across off-list. -- Andy From kennytilton at optonline.net Wed Mar 26 00:13:45 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Tue, 25 Mar 2008 20:13:45 -0400 Subject: [cells-devel] eval-now (utils-kt) In-Reply-To: References: Message-ID: <47E99539.6090206@optonline.net> Andy Chambers wrote: > Is all that export! and eval-now! stuff a convenience for your ide or > is it something you invented to make sure your code gets > loaded/compiled in the right order? None of the above. export! is just more convenient than hunting down the relevant defpackage form to put the exports there. SOme of the eval-now! is necessary for macrology, other to suppress warnings about various things. > > I ask because I'm trying to make what I've done so far at least > asdf-loadable. I don't think there will be any connection -- it is perfectly valid CL -- but if any accommodations must be made lemme know. > There's some code up at > gitorious (http://gitorious.org/projects/hunchncells) if you have a > git available. If not, and you'd like a copy, I can zip it across > off-list. Please do, looks like a bit of a nuisance getting that to run on windows. kenny From achambers.home at googlemail.com Wed Mar 26 14:50:07 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Wed, 26 Mar 2008 14:50:07 +0000 Subject: [cells-devel] family hierarchies In-Reply-To: <47E9AD85.5050407@optonline.net> References: <47E9AD85.5050407@optonline.net> Message-ID: On Wed, Mar 26, 2008 at 1:57 AM, Ken Tilton 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 ). 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 From kennytilton at optonline.net Wed Mar 26 17:28:53 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Wed, 26 Mar 2008 13:28:53 -0400 Subject: [cells-devel] family hierarchies In-Reply-To: References: <47E9AD85.5050407@optonline.net> Message-ID: <47EA87D5.90400@optonline.net> 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) > > 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 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. > > 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. 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 ;-). > > 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 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 From kennytilton at optonline.net Wed Mar 26 23:48:38 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Wed, 26 Mar 2008 19:48:38 -0400 Subject: [cells-devel] CVS weirdness? Kenny weirdness? In-Reply-To: <47EA87D5.90400@optonline.net> References: <47E9AD85.5050407@optonline.net> <47EA87D5.90400@optonline.net> Message-ID: <47EAE0D6.1030308@optonline.net> 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 From frgo at mac.com Thu Mar 27 00:18:40 2008 From: frgo at mac.com (Frank Goenninger) Date: Thu, 27 Mar 2008 01:18:40 +0100 Subject: [cells-devel] CVS weirdness? Kenny weirdness? In-Reply-To: <47EAE0D6.1030308@optonline.net> References: <47E9AD85.5050407@optonline.net> <47EA87D5.90400@optonline.net> <47EAE0D6.1030308@optonline.net> Message-ID: <61EB1DB5-54F0-4CFE-A3EE-0A5F07D4A39D@mac.com> 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 From achambers.home at googlemail.com Thu Mar 27 00:19:38 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Thu, 27 Mar 2008 00:19:38 +0000 Subject: [cells-devel] .kids/.kid-slots Message-ID: Just a quick one, What's the reasoning behind naming these slots this way (instead of kids/kid-slots)? -- Andy From kennytilton at optonline.net Thu Mar 27 00:26:11 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Wed, 26 Mar 2008 20:26:11 -0400 Subject: [cells-devel] .kids/.kid-slots In-Reply-To: References: Message-ID: <47EAE9A3.8020204@optonline.net> Andy Chambers wrote: > Just a quick one, > > What's the reasoning behind naming these slots this way (instead of > kids/kid-slots)? Oops. Makes them show up at the top of the graphical inspector in AllegroCL. Plz don't tell me you just spent three hours trying to figure out why an observer on kids (vs. .kids) did not fire. Actually, the only question is how long you spent on that, not why you ask. :( Sorry! kt From kennytilton at optonline.net Thu Mar 27 01:21:17 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Wed, 26 Mar 2008 21:21:17 -0400 Subject: [cells-devel] CVS weirdness? Kenny weirdness? In-Reply-To: <61EB1DB5-54F0-4CFE-A3EE-0A5F07D4A39D@mac.com> References: <47E9AD85.5050407@optonline.net> <47EA87D5.90400@optonline.net> <47EAE0D6.1030308@optonline.net> <61EB1DB5-54F0-4CFE-A3EE-0A5F07D4A39D@mac.com> Message-ID: <47EAF68D.6030601@optonline.net> 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 From peter.hildebrandt at gmail.com Thu Mar 27 08:56:16 2008 From: peter.hildebrandt at gmail.com (Peter Hildebrandt) Date: Thu, 27 Mar 2008 09:56:16 +0100 Subject: [cells-devel] CVS weirdness? Kenny weirdness? In-Reply-To: <47EAF68D.6030601@optonline.net> References: <47E9AD85.5050407@optonline.net> <47EA87D5.90400@optonline.net> <47EAE0D6.1030308@optonline.net> <61EB1DB5-54F0-4CFE-A3EE-0A5F07D4A39D@mac.com> <47EAF68D.6030601@optonline.net> Message-ID: <47EB6130.3020302@gmail.com> 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 at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel From kennytilton at optonline.net Thu Mar 27 11:15:47 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Thu, 27 Mar 2008 07:15:47 -0400 Subject: [cells-devel] CVS weirdness? Kenny weirdness? In-Reply-To: <47EB6130.3020302@gmail.com> References: <47E9AD85.5050407@optonline.net> <47EA87D5.90400@optonline.net> <47EAE0D6.1030308@optonline.net> <61EB1DB5-54F0-4CFE-A3EE-0A5F07D4A39D@mac.com> <47EAF68D.6030601@optonline.net> <47EB6130.3020302@gmail.com> Message-ID: <47EB81E3.5040305@optonline.net> 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 From achambers.home at googlemail.com Thu Mar 27 20:23:54 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Thu, 27 Mar 2008 20:23:54 +0000 Subject: [cells-devel] cell dependancies Message-ID: I'm not sure whether I would actually need this but was wondering if user code can get a cell's dependancies? Maybe we could pass this information along to the javascript. I've been thinking about the caching thing I mentioned on c.l.l Caching is certainly possible in javascript. Even the browser's own caching system could be used if we use a REST based system although since we're aggregating events, this might not be so useful (lots of unique requests so less chance of a cache hit). The solution would be to send a list of requests, and in the response, include each request with its resulting updates. Add these to the cache and we should get more hits. -- Andy From kennytilton at optonline.net Thu Mar 27 20:35:26 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Thu, 27 Mar 2008 16:35:26 -0400 Subject: [cells-devel] cell dependancies In-Reply-To: References: Message-ID: <47EC050E.4050001@optonline.net> Andy Chambers wrote: > I'm not sure whether I would actually need this but was wondering if > user code can get a cell's dependancies? Sure. The slot on the cell struct is caller-store and it is implemented with my little fifo-queue hack. The fifth argument to an observer is the cell being observed, nil if the model instance slot is not being mediated by a Cell (it was initialized to a constant or optimized away). The default variable name in defobserver if you do not list five is "c". > Maybe we could pass this > information along to the javascript. You mean propagation would happen on the client side? But don't the client nodes always have to go back to the server to get their values? Sorry, I have a lot of ground to make up on this web stuff. I was thinking the web page would be a pure slave made more responsive by the granularity of XMLHTTPRequest (xhr?). > > I've been thinking about the caching thing I mentioned on c.l.l > > Caching is certainly possible in javascript. Even the browser's own > caching system could be used if we use a REST based system although > since we're aggregating events, this might not be so useful (lots of > unique requests so less chance of a cache hit). The solution would be > to send a list of requests, and in the response, include each request > with its resulting updates. Add these to the cache and we should get > more hits. Sorry, ya lost me. :) kenny From achambers.home at googlemail.com Fri Mar 28 13:17:31 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 28 Mar 2008 13:17:31 +0000 Subject: [cells-devel] observer design question Message-ID: 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 do I set up the observer to log the change only if it has not been accounted for already. From frgo at mac.com Fri Mar 28 14:49:43 2008 From: frgo at mac.com (Frank Goenninger) Date: Fri, 28 Mar 2008 15:49:43 +0100 Subject: [cells-devel] observer design question In-Reply-To: References: Message-ID: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> Andy, I don't get what you want to achieve... Am 28.03.2008 um 14:17 schrieb Andy Chambers: > 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 do I set up the observer to log the change only if it has not been > accounted for already. Is it: A kid's observer is firing due to a change but that change should not be reaching the client because the parent's observer's firing is enough for the (web) client to react to? If so, you could suppress the sending of a web client update when *parent* is bound and is not nil (this is meant to mean: I have a parent, so I am a kid. As a kid I don't need to update the client). ??? Frank From kennytilton at optonline.net Fri Mar 28 14:56:02 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 10:56:02 -0400 Subject: [Fwd: Re: [cells-devel] observer design question] Message-ID: <47ED0702.9000705@optonline.net> [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 Organization: Theory Y Learning To: achambers.home at gmail.com References: <47ECF307.5000704 at optonline.net> Andy Chambers wrote: > On Fri, Mar 28, 2008 at 1:30 PM, Ken Tilton 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 From achambers.home at googlemail.com Fri Mar 28 15:06:14 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 28 Mar 2008 15:06:14 +0000 Subject: [cells-devel] observer design question In-Reply-To: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> Message-ID: On Fri, Mar 28, 2008 at 2:49 PM, Frank Goenninger wrote: > Andy, > > I don't get what you want to achieve... > > Am 28.03.2008 um 14:17 schrieb Andy Chambers: > > > > 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 do I set up the observer to log the change only if it has not been > > accounted for already. > > Is it: > > A kid's observer is firing due to a change but that change should not > be reaching the client because the parent's observer's firing is > enough for the (web) client to react to? If so, you could suppress the > sending of a web client update when *parent* is bound and is not nil > (this is meant to mean: I have a parent, so I am a kid. As a kid I > don't need to update the client). No its the other way around. I don't want to have to send the whole page if its just a little bit of text that's changed. There's a javascript library called jquery that allows you to say things like... $("#my-id").html("Hello World"); Translated, that means find the html element with id "my-id" and set the html inside it to be "Hello World". If I can just keep track of all the little changes, I'll send a list of these commands to be eval'd on the client. -- Andy From kennytilton at optonline.net Fri Mar 28 15:15:26 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 11:15:26 -0400 Subject: [cells-devel] observer design question In-Reply-To: References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> Message-ID: <47ED0B8E.2090508@optonline.net> Andy Chambers wrote: > On Fri, Mar 28, 2008 at 2:49 PM, Frank Goenninger wrote: > >>Andy, >> >> I don't get what you want to achieve... >> >> Am 28.03.2008 um 14:17 schrieb Andy Chambers: >> >> >> >>>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 do I set up the observer to log the change only if it has not been >> > accounted for already. >> >> Is it: >> >> A kid's observer is firing due to a change but that change should not >> be reaching the client because the parent's observer's firing is >> enough for the (web) client to react to? If so, you could suppress the >> sending of a web client update when *parent* is bound and is not nil >> (this is meant to mean: I have a parent, so I am a kid. As a kid I >> don't need to update the client). > > > No its the other way around. I don't want to have to send the whole page > if its just a little bit of text that's changed. There's a javascript > library called > jquery that allows you to say things like... > > $("#my-id").html("Hello World"); > > Translated, that means find the html element with id "my-id" and set the html > inside it to be "Hello World". If I can just keep track of all the > little changes, I'll > send a list of these commands to be eval'd on the client. Coolio. I am about to send something with the OpenGL version to help with some ideas. Question: Can you feed #my-id to the browser and then reference it later in a page send? Or must it originally arrive as part of a larger X/HTML tree, only after which it can be referred to directly? kt From achambers.home at googlemail.com Fri Mar 28 15:31:35 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 28 Mar 2008 15:31:35 +0000 Subject: [cells-devel] observer design question In-Reply-To: References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> <47ED0B8E.2090508@optonline.net> Message-ID: Sorry. I keep on sending this stuff to Kenny rather than the list. I've gotta get into the habit of hitting "reply to all" instead of just "reply". On Fri, Mar 28, 2008 at 3:26 PM, Andy Chambers wrote: > On Fri, Mar 28, 2008 at 3:15 PM, Ken Tilton wrote: > > > > > > $("#my-id").html("Hello World"); > > > > > > Translated, that means find the html element with id "my-id" and set the html > > > inside it to be "Hello World". If I can just keep track of all the > > > little changes, I'll > > > send a list of these commands to be eval'd on the client. > > > > Coolio. I am about to send something with the OpenGL version to help > > with some ideas. > > > > Question: Can you feed #my-id to the browser and then reference it later > > in a page send? Or must it originally arrive as part of a larger X/HTML > > tree, only after which it can be referred to directly? > > If you mean "Do all id's have to be known up front?". The answer is no. The > example above could be changed to > > $("#my-id").html("

some more stuff

"); > > and now we have a new fully fledged node in the DOM with all the rights > and privileges of whatever was initially sent. > From kennytilton at optonline.net Fri Mar 28 15:34:52 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 11:34:52 -0400 Subject: [cells-devel] observer design question In-Reply-To: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> Message-ID: <47ED101C.4040201@optonline.net> Frank Goenninger wrote: > Andy, > > I don't get what you want to achieve... > > Am 28.03.2008 um 14:17 schrieb Andy Chambers: > >> 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 do I set up the observer to log the change only if it has not been >> accounted for already. > > > Is it: > > A kid's observer is firing due to a change but that change should not > be reaching the client because the parent's observer's firing is enough > for the (web) client to react to? If so, you could suppress the sending > of a web client update when *parent* is bound and is not nil (this is > meant to mean: I have a parent, so I am a kid. As a kid I don't need to > update the client). > > ??? > This is an interesting case where we can get some efficiency where the engine we are driving allows it. DHTML lets us change a specific node in the DOM without resending a whole page, OpenGL lets us rebuild a display list and have it take effect whenever any larger display list calls it: (defmd ogl-node () (dsp-list (c-formula (:lazy :until-asked) (without-c-dependency (map nil 'dsp-list (kids self))) (let ((display-list-name (or .cache (gl-gen-lists 1)))) ; #1 ;---start building this list ----- (gl-new-list display-list-name gl_compile) (ix-paint self) (gl-end-list) ;---end building (setf (redisplayp .og.) t) ; Note #2 display-list-name))) ;; always the same once allocated #1 display-list-name (actually just an integer) is like an OpenGL object ID. When larger structures render, they render kids by "calling" the kids' display lists by these names. gl-call-list or something. #2 notice that this rule mutates the display list, it does not allocate a new one. (The whole scheme breaks down if we do that.) So we will forever be returning the same "name" and so the Cells engine will not see any change. Observers will not run and (crucially) users will not get invalidated. This is way cool because this is exactly what we want. The only dependencies arise during that call you see to IX-PAINT. If I reference any other cell and that changes, then when the name slot gets sampled Cells will kick off the rule to rebuild the list. When do they get sampled? I think the display callback runs down the visual hierarchy sampling each node's list to get it rebuilt before runnning down it again to actually render -- you cannot build a display list and render at the same time. So it is both a little awkward yet strangely Cells-friendly. kt From kennytilton at optonline.net Fri Mar 28 15:57:53 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 11:57:53 -0400 Subject: [cells-devel] observer design question In-Reply-To: <47ED101C.4040201@optonline.net> References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> <47ED101C.4040201@optonline.net> Message-ID: <47ED1581.7050208@optonline.net> I should have added more notes: > This is an interesting case where we can get some efficiency where the > engine we are driving allows it. DHTML lets us change a specific node in > the DOM without resending a whole page, OpenGL lets us rebuild a display > list and have it take effect whenever any larger display list calls it: > > (defmd ogl-node () > (dsp-list > (c-formula (:lazy :until-asked) "lazy" to start because we cannot build a display list until the opengl context gets established. Eager thereafter because (I was wrong, we do not need to artificially sample each list on each display call to get the invalid lists rebuilt) we want propagation of any releavnt change to kick off the rule to get the display list rebuilt. > (without-c-dependency > (map nil 'dsp-list (kids self))) Here I am getting kids ready before I myself build my list: an OpenGL list can recursively /call/ other lists, but we can /build/ recursively, so I sample all my kids before building. I do it without-dependency because this is the issue Andy raised: a sub-node changing does not mean we need to resend the parent node. > (let ((display-list-name (or .cache (gl-gen-lists 1)))) ; #1 > ;---start building this list ----- > (gl-new-list display-list-name gl_compile) > (ix-paint self) > (gl-end-list) > ;---end building > (setf (redisplayp .og.) t) ; Note #2 I forgot to explain that normally we would have an observer on the slot trigger the redisplay, but these slots do not change in value, they mutate the display list definition on the OpenGL side, so we have to trigger the redisplay differently. And this is just a bit of global state that needs to get set /someplace/, no harm if a hundred lists say "redisplay!". kt > display-list-name))) ;; always the same once allocated > > #1 display-list-name (actually just an integer) is like an OpenGL object > ID. When larger structures render, they render kids by "calling" the > kids' display lists by these names. gl-call-list or something. > > #2 notice that this rule mutates the display list, it does not allocate > a new one. (The whole scheme breaks down if we do that.) So we will > forever be returning the same "name" and so the Cells engine will not > see any change. Observers will not run and (crucially) users will not > get invalidated. This is way cool because this is exactly what we want. > The only dependencies arise during that call you see to IX-PAINT. If I > reference any other cell and that changes, then when the name slot gets > sampled Cells will kick off the rule to rebuild the list. > > When do they get sampled? I think the display callback runs down the > visual hierarchy sampling each node's list to get it rebuilt before > runnning down it again to actually render -- you cannot build a display > list and render at the same time. > > So it is both a little awkward yet strangely Cells-friendly. > > kt > > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel > From achambers.home at googlemail.com Fri Mar 28 16:07:29 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Fri, 28 Mar 2008 16:07:29 +0000 Subject: [cells-devel] observer design question In-Reply-To: <47ED12D7.1040206@optonline.net> References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> <47ED0B8E.2090508@optonline.net> <47ED12D7.1040206@optonline.net> Message-ID: On Fri, Mar 28, 2008 at 3:46 PM, Ken Tilton wrote: > Andy Chambers wrote: > > On Fri, Mar 28, 2008 at 3:15 PM, Ken Tilton wrote: > > > >> > > >> > $("#my-id").html("Hello World"); > >> > > >> > Translated, that means find the html element with id "my-id" and set the html > >> > inside it to be "Hello World". If I can just keep track of all the > >> > little changes, I'll > >> > send a list of these commands to be eval'd on the client. > >> > >> Coolio. I am about to send something with the OpenGL version to help > >> with some ideas. > >> > >> Question: Can you feed #my-id to the browser and then reference it later > >> in a page send? Or must it originally arrive as part of a larger X/HTML > >> tree, only after which it can be referred to directly? > > > > > > If you mean "Do all id's have to be known up front?". > > No, I meant /can they be/ defined up front, or even later in one > stream. ie, as long as all the pieces are in place (as identified by ID) > by the time the browser has to actually render we are good to go. Yes you can do this. As long as something has been "injected" into the DOM (whether as part of the original page load, or as a DOM manipulation, you can select it in a subsequent command. > btw, I gather we can have a path ID where each segment corresponds to a > node higher in the hierarchy? So I could specify /body/left-leg/sock and > /body/right-leg/sock and have the DOM wearing two different socks? Yup. Jquery supports that particular subset of xpath (although with a slightly different syntax). From kennytilton at optonline.net Fri Mar 28 18:05:41 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 14:05:41 -0400 Subject: [cells-devel] observer design question In-Reply-To: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> References: <6AC8CD27-3A78-44FB-9293-873837ACC540@mac.com> Message-ID: <47ED3375.8080603@optonline.net> haha! Nice exchange, it persuaded me (along with FG's report a while back of success) to re-enable display lists, so far (touch wood) it Just Works! Not that things were slow without them... hmm, maybe I better check and make sure they are not... nope... but still, should make things even zippier. I have been thinking about it, it sounds as if we can treat Ajax like OpenGL so we have a leg up on the implementation. kt From achambers.home at googlemail.com Sat Mar 29 01:02:50 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Sat, 29 Mar 2008 01:02:50 +0000 Subject: [cells-devel] open-air code Message-ID: Hi Kenny, Here's my attempt at pushing changes to an updates slot. Would you mind having a look to see if you can see why its not working? The stuff of interest is..... updates on the the web-app model xuid on the html model xhtml also on the html model What's happening is that when it comes to printing the updates slot (just before it would be sent down to an xhr), its populated with all nodes the first time around, then nothing thereafter. All the models are made using defmodel rather than defmd because that's what celtk did (presumably before defmd was invented). Once I've got the updates working, I'll try to change these to use defmd instead. The only non-cells dependencies are cl-who and hunchentoot both of which are asdf-installable but you may be able to see the problem without having to install these. -------------- next part -------------- A non-text attachment was scrubbed... Name: open-air.zip Type: application/zip Size: 42823 bytes Desc: not available URL: From kennytilton at optonline.net Sat Mar 29 01:12:44 2008 From: kennytilton at optonline.net (Ken Tilton) Date: Fri, 28 Mar 2008 21:12:44 -0400 Subject: [cells-devel] open-air code In-Reply-To: References: Message-ID: <47ED978C.1070209@optonline.net> Andy Chambers wrote: > Hi Kenny, > > Here's my attempt at pushing changes to an updates slot. Would you > mind having a look to see if > you can see why its not working? > > The stuff of interest is..... > > updates on the the web-app model > xuid on the html model > xhtml also on the html model > > What's happening is that when it comes to printing the updates slot > (just before it would be sent > down to an xhr), its populated with all nodes the first time around, > then nothing thereafter. > > All the models are made using defmodel rather than defmd because > that's what celtk did (presumably > before defmd was invented). Once I've got the updates working, I'll > try to change these to use defmd > instead. Not an issue. defmd is pure syntactic sugar (but a pure joy -- I convert defmodel forms to defmd whenever I happen to be modifying one). > > The only non-cells dependencies are cl-who and hunchentoot both of > which are asdf-installable but > you may be able to see the problem without having to install these. I will try without. asdf-install is beyond me -- somehow requires Cygwin IIRC -- and I only got about half way through building everything hunch requires. kt From achambers.home at googlemail.com Mon Mar 31 16:28:30 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 31 Mar 2008 17:28:30 +0100 Subject: [cells-devel] html attributes Message-ID: Hi Kenny, As you may have noticed in the examples I put up earlier, each html has a number of allowed attributes. This mirrors quite closely the options you can set in tk. The macros I've defined so far actually provide a nice benefit (that doesn't seem to exist in any of the other html generation libraries) of validating your html. For example, if you tried to put a "fizzle" attribute on some element, you'd get an error whereas this would be perfectly acceptable in many other html generation libraries. I think that some of the Haskell ones do clever things with typing to achieve the same effect. The drawback, as far as I can see is that this pollutes the namespace by adding a whole bunch of methods that do essentially the same thing. If someone wanted to use this library, many useful names like "onclick", and "href" would be snapped up already. Is the solution just to make a short nickname, then people can just use the package qualified names for all the functions we export. Cheers, Andy From amq at common-lisp.net Mon Mar 31 18:06:22 2008 From: amq at common-lisp.net (Candice) Date: Mon, 31 Mar 2008 19:06:22 +0100 Subject: [cells-devel] 100% Safe To Take, With NO Side Effects. Message-ID: <47F11A0E.4080005@common-lisp.net> Men are going to stand up and clap their hands at these penis enlargement capsules. It has produced remarkable results that have never been seen before with NO negative side effects. These penis enlargement capsules offer women what they really want, more to play with! Those extra inches really do make the difference! http://yutoutye.com regards,