From kentilton at gmail.com Thu Jun 1 20:07:16 2006 From: kentilton at gmail.com (Ken Tilton) Date: Thu, 1 Jun 2006 16:07:16 -0400 Subject: [cells-devel] Fwd: Just can't hear enough about Cells? In-Reply-To: <447f481f.05757509.6d86.ffffd175SMTPIN_ADDED@mx.gmail.com> References: <1gGeg.29$XB5.10@fe09.lga> <447f481f.05757509.6d86.ffffd175SMTPIN_ADDED@mx.gmail.com> Message-ID: ---------- Forwarded message ---------- From: Anon Date: Jun 1, 2006 4:03 PM Subject: Re: Just can't hear enough about Cells? To: Ken Tilton I'm getting a ton of garbage when trying to ASDF-INSTALL :cells What's going on? here follows: * (asdf-install:install :cells) Install where? 1) System-wide install: System in /usr/lib/sbcl/site-systems/ Files in /usr/lib/sbcl/site/ 2) Personal installation: System in /home/oper/.sbcl/systems/ Files in /home/oper/.sbcl/site/ --> 2 Downloading 74072 bytes from http://common-lisp.net/project/cells/asdf- install/cells_2.0.tar.gz ... debugger invoked on a ASDF-INSTALL::KEY-NOT-TRUSTED in thread #: GPG warns that the key id 0xNIL () is not fully trusted Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [CONTINUE ] Install the package anyway 1: [SKIP-GPG-CHECK] Don't check GPG signature for this package 2: [ABORT ] Exit debugger, returning to top level. (ASDF-INSTALL::VERIFY-GPG-SIGNATURE/STRING "-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 M?wBcells_2.0.tar?\\[s?F????+???];9??BKt?]YrIr?f?\"\"`0d?_~ ??^~????)U???X?i???Od????b7??_??????W/??p????^j????+L ?O???t???????? ?Z?J?I?H??X?\\\\??B(r)??\\?i\\?Y*? ?Y? Q???(r)?_???? ????\\gy?\"L?b?Rt.E$?N&Q?#?Nd??X q\"?|EI??;??v?b7????u?%?\"?U!eH???4K?(L?? ????? ????x6?L??=??S?D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) iD8DBQFD1qcfl2RwVlDQtPYRApX/AKCFgsrLXsv8FllEQ1YQtC2nYRZiHACcDkJY whE3bSaRgquYThmepNzfYVc= =Pacw -----END PGP SIGNATURE----- " #P"/home/oper/projects/db-project/order-entry/CELLS.asdf-install-tmp") 0] PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuT TYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYP uTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Thu Jun 1 20:10:23 2006 From: kentilton at gmail.com (Ken Tilton) Date: Thu, 1 Jun 2006 16:10:23 -0400 Subject: [cells-devel] Re: Just can't hear enough about Cells? In-Reply-To: <447f481f.05757509.6d86.ffffd175SMTPIN_ADDED@mx.gmail.com> References: <1gGeg.29$XB5.10@fe09.lga> <447f481f.05757509.6d86.ffffd175SMTPIN_ADDED@mx.gmail.com> Message-ID: On 6/1/06, Anon wrote: > > > I'm getting a ton of garbage when trying > to ASDF-INSTALL :cells > What's going on? Sorry, I do not know anything about asdf-install. I forwarded your note separately to the cell-devel list. If you know of any asdf support list, I suggest you try that. Here is where you can just get the tarball: http://common-lisp.net/cgi-bin/viewcvs.cgi/cells/?root=cells kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwking at metabang.com Thu Jun 1 20:58:02 2006 From: gwking at metabang.com (Gary King) Date: Thu, 1 Jun 2006 16:58:02 -0400 Subject: [cells-devel] Fwd: Just can't hear enough about Cells? In-Reply-To: References: <1gGeg.29$XB5.10@fe09.lga> <447f481f.05757509.6d86.ffffd175SMTPIN_ADDED@mx.gmail.com> Message-ID: <3E1D02C7-B119-466E-BCA3-48AA8B5CBADD@metabang.com> Hi, the problem is that the "signature file" isn't a detached signature. If you choose the restart to continue past the gpg check, everything seems to work OK (i.e., I haven't tested it but the system compiles). Regards, On Jun 1, 2006, at 4:07 PM, Ken Tilton wrote: > > > ---------- Forwarded message ---------- > From: Anon > Date: Jun 1, 2006 4:03 PM > Subject: Re: Just can't hear enough about Cells? > To: Ken Tilton > > > I'm getting a ton of garbage when trying > to ASDF-INSTALL :cells > What's going on? > > here follows: > > * (asdf-install:install :cells) > Install where? > 1) System-wide install: > System in /usr/lib/sbcl/site-systems/ > Files in /usr/lib/sbcl/site/ > 2) Personal installation: > System in /home/oper/.sbcl/systems/ > Files in /home/oper/.sbcl/site/ > --> 2 > Downloading 74072 bytes from http://common-lisp.net/project/cells/ > asdf- > install/cells_2.0.tar.gz ... > > debugger invoked on a ASDF-INSTALL::KEY-NOT-TRUSTED in thread > #: > GPG warns that the key id 0xNIL () is not fully trusted > > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. > > restarts (invokable by number or by possibly-abbreviated name): > 0: [CONTINUE ] Install the package anyway > 1: [SKIP-GPG-CHECK] Don't check GPG signature for this package > 2: [ABORT ] Exit debugger, returning to top level. > > (ASDF-INSTALL::VERIFY-GPG-SIGNATURE/STRING > "-----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > M?wBcells_2.0.tar?\\[s?F????+???];9??BKt?]YrIr?f?\"\"`0d?_~ > ??^~????)U???X?i???Od????b7??_??????W/??p????^j????+L ?O???t???????? > ?Z?J?I?H??X?\\\\??B???\\?i\\?Y*? ?Y? > > Q?????_???? > ????\\gy?\"L?b?Rt.E$?N&Q?#?Nd??X > q\"?|EI??;??v?b7????u?%?\"?U!eH???4K?(L?? ?,?aq:Z?z?? > ?bsX?????`?{?????????????c??Y)?Y??cc?e?{?????J!%5h???y,?H2\"??Y > \"E???Z??P?P??h > ??Ux/????MdQ?\\ > g? ?Xe?7(\"ne??y0??,*W > > > > > > ????? > ????x6?L??=??S?D > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.0 (Darwin) > > iD8DBQFD1qcfl2RwVlDQtPYRApX/AKCFgsrLXsv8FllEQ1YQtC2nYRZiHACcDkJY > whE3bSaRgquYThmepNzfYVc= > =Pacw > -----END PGP SIGNATURE----- > " > #P"/home/oper/projects/db-project/order-entry/CELLS.asdf-install-tmp") > 0] > PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY > PuT > TYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuT > TYP > uTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY > > > > > > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally) From larsnostdal at gmail.com Fri Jun 2 20:09:44 2006 From: larsnostdal at gmail.com (=?UTF-8?Q?Lars_Rune_N=C3=B8stdal?=) Date: Fri, 2 Jun 2006 22:09:44 +0200 Subject: [cells-devel] Tiny patch Message-ID: Hello, Just a tiny "patch"; the NIL (in uppercase) caused some troubles in `cells.lisp' for me when *readtable* is set to :invert. -(defparameter *client-queue-handler* NIL) +(defparameter *client-queue-handler* nil) -- Mvh, Lars Rune N?stdal http://lars.nostdal.org/ From kentilton at gmail.com Wed Jun 7 17:35:59 2006 From: kentilton at gmail.com (Ken Tilton) Date: Wed, 7 Jun 2006 13:35:59 -0400 Subject: [cells-devel] Re: question about cells In-Reply-To: References: Message-ID: On 6/7/06, Lars Rune N?stdal wrote: > > i keep getting this: > > (setf md-slot-value)> cellular slot value of # > cannot be setf unless initialized as inputp > > if i've understood this message correctly; it means that i'm trying to > setf a slot with `:initform (c? ...)' .. No, that should give you a different error saying you cannot SETF a /ruled/ slot, but I just checked to get the text of that error (and tested for it) and am rather astounded to see that that discipline is no longer enforced. I will have to investigate. :) The error you are getting means the slot has been initialized to some plain Lisp value such as NIL or "Hello world", without any Cell wrapper as one would get with c-in or c-input or any of the macros to generate ruled Cells. Which means.... but the slot i'm having > trouble with resides in a superclass of `InputText' and is defined > like this: > > .. > (value :accessor value-of :initarg :value > :initform (c-in "")) This initform (which is fine) has been overridden at make-instance time with something like: :value "Test" hth, kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Wed Jun 7 22:27:37 2006 From: kentilton at gmail.com (Ken Tilton) Date: Wed, 7 Jun 2006 18:27:37 -0400 Subject: [cells-devel] Re: question about cells In-Reply-To: References: Message-ID: > > Hmm, maybe the error does not need to announce where it is in the source? > OK, I just committed code to produce this (we can continue refining if necessary, but I like this so wanted to get it in): Break: cellular slot STATUS of # cannot be SETFed because it is not mediated by a Cell with :inputp t. To achieve this, the initial value :ON -- whether supplied as an :initform, :default-initarg, or at make-instance time via an :initarg -- should be wrapped in either macro C-IN or C-INPUT. In brief, initialize STATUS to (c-in :ON) instead of plain :ON Code: (unless c (c-break "cellular slot ~a of ~a cannot be SETFed because it is not mediated by a Cell with :inputp t. To achieve this, the initial value ~s -- whether supplied as an :initform, :default-initarg, or at make-instance time via an :initarg -- should be wrapped in either macro C-IN or C-INPUT. In brief, initialize ~0@*~a to (c-in ~2@*~s) instead of plain ~:*~s" slot-name self (slot-value self slot-name))) ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Fri Jun 9 16:14:59 2006 From: kentilton at gmail.com (Ken Tilton) Date: Fri, 09 Jun 2006 12:14:59 -0400 Subject: [cells-devel] Re: Question about Cells; defobserver for both I and O In-Reply-To: <1149857240.786812.320460@j55g2000cwa.googlegroups.com> References: <1149857240.786812.320460@j55g2000cwa.googlegroups.com> Message-ID: <44899E83.8080107@gmail.com> Lars Rune N?stdal wrote: > Hi Lispers, > Ok, starting to get the hang of this, but I'm having a small issue > maybe you guys could help me with. > > I'm playing with some AJAX-stuff and .. hm .. not sure how to explain > this proper, but .. Fair warning: I have never programmed a Web app, barely done anything with HTML, and understood almost nothing of what you wrote. :) But this (check me: input form field initialized from a database record field, then overwritten by user so data must flow the other way back to the DB?) happens all the time in standalone apps, so... > > I have an INPUT-element (HTML) that can be used for both input of data > (client-initiated) and output of data (server-initiated), and I'd like > to block the observer so it does not react on input from the client and > tries to re-update the element .. > > ..or maybe "blocking" the observer isn't right at all, maybe I'm going > about this the wrong way..? As I said, this comes up all the time, and what you tried is the tempting automatic flow: DB(existing value -> Input(as initial value) -> DB(new value) Your code is what I think about writing even after ten years of using Cells. So how do we break the cycle? There are several ways I have handled this. 1. In the slot definition, specify: (value ...etc... :unchanged-if 'string=) You will still make the return trip to set the input field unnecessarily, but that will be an NOP because the new value will be seen as unchanged, stopping propagation (including calling observers). The default test is EQL and it is easy in even simple code for 'string= but un-EQL strings to arise and start cycling. To avoid even the beginnings of a roundtrip, hey, have the observer take a peek at where it is about to write and decide if it needs to. Not as much fun as letting Cells worry about it, but this one observer (I gather) is handling all the HTML input fields, so...? Now I revert to my earlier disclaimer about being Web-ignorant: I think The Right Answer overall will be decided by the exact nature of the Web stuff, so I will just continue dumping alternatives 2. Does the DB flow to the form only when the form is opened? If so, the HTML input fields can have a something another Cells user just requested: a rule that runs once at initialization time and then becomes a /Cells/ input. ie, the slot starts as c-formula but then becomes c-input. (No dependencies are recorded during the initial rule invocation.) Only the HTML input field has an observer writing back to the corresponding DB field. Now if only cells had some frickin decent doc I could tell you the syntax. Maybe: (c-formula (:inputp t) ) If that is what you settle on and it does not work I will research further. 3. if you are in a multi-user environment or for any other reason need to update the form programmatically at the same time the user is typing, well, things will be pretty exciting for the user , and it may be time to consider the failsafe: do not try to use Cells dataflow where the application really needs to decide the dataflow. An application flow will have to be concocted, hopefully facilitated by Cells, but always keep in mind that the functionality might dictate more savvy than the Cells changed/not-changed propagation smarts. hth, ken > Here is some code: > > > (defobserver value ((value-attribute ValueAttribute)) > (cells::trc "ValueAttribute changing from" old-value :to new-value) > (terpri) > ;; Update the value-attribute of the HTML-element on the client-side. > (setAttribute (parent-of value-attribute) > (name-of value-attribute) > "value" > (princ-to-string (value-of value-attribute)))) > > (defmethod onkeyup ((value-attribute ValueAttribute) (parent Container) > &rest event-args) > (format t "onkeyup: ~A~%" (fifth event-args)) > (setf (value-of value-attribute) > (first event-args))) > > > `onkeyup' is called from the client-side and since (setf value-of ..) > triggers the observer for the slot `value', it tries to "redraw" what's > already on the client-side. > -- Cells: http://common-lisp.net/project/cells/ "I'll say I'm losing my grip, and it feels terrific." -- Beaming husband to scowling life, New Yorker cartoon From kentilton at gmail.com Sat Jun 10 14:03:14 2006 From: kentilton at gmail.com (Ken Tilton) Date: Sat, 10 Jun 2006 10:03:14 -0400 Subject: [cells-devel] Gmane archiving for cells-devel? Message-ID: I am not much up on this Gmane thingy, but apparently this list is headed that way (and this message exists just to trigger activation so i can be sure). kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Sat Jun 10 22:30:38 2006 From: kentilton at gmail.com (Ken Tilton) Date: Sat, 10 Jun 2006 18:30:38 -0400 Subject: [cells-devel] Small change Message-ID: I just modified md-slot-value-assume to test for "no news" just a wee bit sooner within the function. The regression test passes, as does Celtk's lotsa-widgets test. But I thought I would warn users in case they update from CVS soon. My concern is that I do not know why I had it so late in the past -- probably because the unnecessary actions taken were so inexpensive -- so maybe it was where it was for a reason. But as I said, all the tests pass as well as real-live Celtk code (which itself exercises Cells pretty well) so it looks OK. kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From larsnostdal at gmail.com Mon Jun 12 17:15:16 2006 From: larsnostdal at gmail.com (=?UTF-8?Q?Lars_Rune_N=C3=B8stdal?=) Date: Mon, 12 Jun 2006 19:15:16 +0200 Subject: [cells-devel] chat-server using cells? Message-ID: Hi, I'm trying to figure out how to design a chat-server using Cells. This doesn't work, but this is what I've come up with: (defpackage CellsChat (:use :cl :cells)) (in-package :CellsChat) (defparameter *newline* (princ-to-string #\Newline)) (defmodel CellsChat () ((username :cell nil :accessor username-of :initarg :username :initform (error "CellsChat needs a `username'.")) (text-box :accessor text-box-of :allocation :class :initform (c-in "")) (participants :cell nil :accessor participants-of :allocation :class :initform nil))) (defmethod initialize-instance :after ((chat CellsChat) &key) ;; New user joins the conversation. (push chat (participants-of chat)) ;; New user wants to see what's been going on recently. (updateTextBox chat)) (defmethod updateTextBox ((chat CellsChat)) ;; Show conversation till now. (format t "(text-box-of ~A): '~A'~%" (username-of chat) (text-box-of chat))) (defobserver text-box ((chat CellsChat)) ;; Update interface of each participant whenever ;; `text-box' changes (for whatever reason). (dolist (participant (participants-of chat)) (updateTextBox participant))) (defmethod say ((chat CellsChat) (what string)) (setf (text-box-of chat) (concatenate 'string (text-box-of chat) (username-of chat) ": " what *newline*))) (defmethod part ((chat CellsChat)) ;; User leaves the conversation. (setf (participants-of chat) (delete chat (participants-of chat)))) -- Mvh, Lars Rune N?stdal http://lars.nostdal.org/ From larsnostdal at gmail.com Tue Jun 13 01:04:38 2006 From: larsnostdal at gmail.com (=?UTF-8?Q?Lars_Rune_N=C3=B8stdal?=) Date: Tue, 13 Jun 2006 03:04:38 +0200 Subject: [cells-devel] Re: chat-server using cells? In-Reply-To: References: Message-ID: ok, after some mailing with Kenny - this works: (defpackage CellsChat (:use :cl :cells)) (in-package :CellsChat) (defparameter *newline* (princ-to-string #\Newline)) (defmodel Participant () ((chat :cell nil :accessor chat-of :initarg :chat :initform (error "Participants need something for its `chat'-slot.")) (username :cell nil :accessor username-of :initarg :username :initform (error "CellsChat needs a `username'.")) (speech :cell :ephemeral :accessor speech-of :initarg :speech :initform (c-in nil)))) (defmethod initialize-instance :after ((participant Participant) &key) (push participant (participants-of (chat-of participant)))) (defobserver speech ((participant Participant)) ;; `new-value' always refers to the slot `speech' ;; since that is what we're observing (when new-value (dolist (participant (participants-of (chat-of participant))) (format t "Update interface for '~A', appending: ~A~%" (username-of participant) new-value)))) (defmethod say ((participant Participant) (what string)) (setf (speech-of participant) (concatenate 'string (username-of participant) ": " what *newline*))) (defmodel Chat () ((text-box :accessor text-box-of :initform (c? (concatenate 'string ;; conversation till now.. (or .cache "") ;; well, ok then - this is neat O_o (some 'speech-of (participants-of self))))) (participants :accessor participants-of :initform (c-in nil)))) (defun testChat () (let* ((chat (make-instance 'Chat)) (user1 (make-instance 'Participant :username "user1" :chat chat)) (user2 (make-instance 'Participant :username "user2" :chat chat))) (say user1 "Hello, anyone here?") (say user2 "Well hello there - I'm here :)") (say user1 "Cool .. what's up?") (say user2 "Just doing some Lisp-hacking -- you?") (say user1 "Naaaw .. nothing; I'm kind of tired, so I'm just sitting in the sun here listening to some music"))) ..pretty darn cool :) -- Mvh, Lars Rune N?stdal http://lars.nostdal.org/ From kentilton at gmail.com Tue Jun 13 03:36:19 2006 From: kentilton at gmail.com (Ken Tilton) Date: Mon, 12 Jun 2006 23:36:19 -0400 Subject: [cells-devel] Re: chat-server using cells? In-Reply-To: References: Message-ID: OK, here is the promised write-up, with a scary proposed fix. What do you all think? the code, btw, ships in broken form: the text-box will not have a complete record. Move the featuring around in the text-box rule to make an awkward fix tantamount to the fix I have in mind to for the Cells engine. I will follow up separately with a discussion of the proposed fix. kenny (defpackage #:tu-some-ephemeral-uhoh (:use :cl :utils-kt :cells :tu-cells)) (in-package #:tu-some-ephemeral-uhoh) #| SOME over a list of ephemerals will not establish useful dependencies. Actually, I think there is just a larger problem with the current implementation of ephemerals. More below. The short-term fix is to force iteration over all ephemerals, then return the first found. This is because ephemerals do not change to NIL visibly to propagation -- it is a silent reset done by internals. Details follow: Normally Cells and SOME get along fine. The spirit of SOME is to find just the first non-nil result in a list, returned by its predicate argument. To stay current with such an expression after non-nil value V is returned by some instance F (the first instance in the list to return a non-nil value), the rule should run if: an instance appearing earlier in the list would now return a non-nil value the predicate would return a different value V2 if applied to the same instance F in the special case where the new value returned by F would be nil, we want a new search down the list until (possibly) some other instance F2 returns a value. Well, as I said, normally that works fines, assuming the predicate's return value is affected only by Cells. (This, btw, is a good example of why it is hard to be "a little bit Cells".) Dependencies will exist on the population of the list of instances, and, for all instances up to F, dependencies will exist on all Cells going into the predicate's derivation of a value. If you stare at the three cases above, you will see that they all work. Note also that they work even though no dependencies exist from applying the predicate to instances /after/ F. That is because they do not matter until F decides to return NIL, and but that change will trigger the rule to run again and sail past F to (possibly) some new F2, establishing dependencies all along the way. And now the problem. Suppose the predicate simply reads and ephemeral slot. Some instance F takes on a value V for that slot and the rule runs. The value V gets returned, so the rule is not dependent on any instance after F. Fine. But when this propagation completes, because the slot is ephemeral, it reverts to nil without propagating, which is exactly when above the rule ran again, sailed past F and established dependencies of instances farther down the list, ready for someone to turn non-nil. When some F2 farther down the line /does/ change to return a non-nil, or even if it was ready to return a non-nil when F did so it never got asked (SOME just wants the first), the rule having no dependency past F will not run. The solution? Do not use SOME in conjunction with ephemerals. Iterate over the whole list to establish dependencies and then take the first result found. if this is to inefficient, have an observer on the ephemeral propagate state change via deferred SETF. Meanwhile, i will be looking for a fix that makes ephemerals more transparent. The only thing that springs to mind (this is a preview) is re-running the rule after resetting the ephemeral just to establish the dependencies. Which is sick because the code will branch differently -- but that is the idea! Like I said, sick. :) |# (defparameter *newline* (princ-to-string #\Newline)) (defmodel cells-chat (family) ;; kids slot can be partcipants ((text-box :initarg :text-box :accessor text-box :initform (let (last-chatters) (c? (let ((latest-speech ;; broken... (some (lambda (p) (when (speech p) ;(print (speech p)) (cons p (speech p)))) ;; no dependencies after this (^kids)) ;; fixed (always hit all speeches to estab dependencies) #+(or) (loop with result for p in (^kids) when (and (speech p) (not result)) ;; this order or same bug do (setf result (cons p (speech p))) finally (return result)) ) (new-chatters (set-difference (^kids) last-chatters)) (lost-chatters (set-difference last-chatters (^kids)))) (prog1 (cond (latest-speech (destructuring-bind (p . s) latest-speech (concatenate 'string (or .cache "") (username p) ": " s *newline*))) (lost-chatters (concatenate 'string (or .cache "") (format nil "~a has/have left the chat~a" (mapcar 'username lost-chatters) *newline*))) (new-chatters (concatenate 'string (or .cache "") (format nil "~a has/have joined the chat~a" (mapcar 'username new-chatters) *newline*))) (t .cache)) (setf last-chatters (^kids))))))))) (defmodel chatter (model) ((username :cell nil :accessor username :initarg :username :initform (error "chatter needs a `username'.")) (speech :cell :ephemeral :initform (c-in nil) :initarg :speech :accessor speech))) (defobserver text-box ((chat cells-chat) new-value old-value) #+confusingoutput (when new-value (format t "~&--------------(text-box-of ~A)------------------:~&'~A'~%" chat new-value))) (defun tu-cells::tu-some-ephemeral-uhoh () (cells-reset) (let* ((chat (make-instance 'cells-chat)) (lars (make-instance 'chatter :fm-parent chat :username "Lars"))) (push lars (kids chat)) (setf (speech lars) "Cells are different.") (push (make-instance 'chatter :fm-parent chat :username "Kenny") (kids chat)) (setf (speech lars) "Hi, kenny") ; ; this next state change causes the text-box to lose its dependency on (speech lars)... ; (setf (speech (car (kids chat))) "Hi, Lars. That's for sure. Takes a while to adjust.") ; ; this next state change will not be propagated... ; (setf (speech lars) "OK, I'll keep plugging") (depart-chat lars) (print (text-box chat)))) (defun depart-chat (chatter) (print `(departing ,chatter)) (setf (kids (fm-parent chatter)) (remove chatter (kids (fm-parent chatter))))) -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Tue Jun 13 04:20:33 2006 From: kentilton at gmail.com (Ken Tilton) Date: Tue, 13 Jun 2006 00:20:33 -0400 Subject: [cells-devel] I think it's a bug [was SOME vs The Ephemerals] Message-ID: If you have been following the drama, i broke Lars's chat log with this rule (somewhat revised): (chat-log:accessor chat-log :initform (c? (concatenate 'string (or .cache "") (some 'speech-of (participants-of self))))) SOME stops at the first non-nil speech, establishing no dependencies on the speech of any participant farther down the "participants-of" list. This is a problem, because speech-of is an ephemeral. It gets set to nil /without/ propagating after any non-nil value gets set and propagated. That is what ephemerals are all about, and I think that much is solid....... maybe not. We'll come back to this. Anyway, if someone farther down the list now says something, the rule does not run because it has no dependency on their speech. And the log misses an entry. Now I could just call this a user error ("Hey, Kenny! No dependency, no re-calc!") and wipe my hands of the whole mess, but I have been doing Cells for ten years and I had to debug in the internals for the first time in a lonnng time to figure this one out, so I think an unwritten law is being violated: normal, healthy Lisp code should transparently maintain dependencies automatically. deep background: if there is no way around this, so be it, we have an entry for a "gotchas" FAQ. But one thing that ruins supercool libraries is exactly this sort of violation of the principle of least surprise. So I want to see if the above code can be made to work. What I was thinking (until just now) was that any time a rule encountered an ephemeral, just after the ephemeral got reset, the rule should be rerun just to establish dependencies, not for its value. The code would be simple (famous last words): after resetting an ephemeral, iterate over all dependents of the ephemeral and call their rule, ignoring the return value. Weird, but I bet it works. The alternative is to implement the "reset ephemeral step" actually as a proper datapulse in which the ephemeral is set to NIL. Full propagation, including observers of the ephemeral. Boy, that sure weakens the ephemerality metaphor. :) Thoughts? Meanwhile, I will canvas real-world uses of ephemeral cells for inspiration. cheers, kenneth -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Tue Jun 13 02:13:07 2006 From: kentilton at gmail.com (Ken Tilton) Date: Mon, 12 Jun 2006 22:13:07 -0400 Subject: [cells-devel] Re: chat-server using cells? In-Reply-To: References: Message-ID: On 6/12/06, Lars Rune N?stdal wrote: > > ok, after some mailing with Kenny - this works: > > > (defpackage CellsChat > (:use :cl :cells)) > (in-package :CellsChat) > > > (defparameter *newline* (princ-to-string #\Newline)) > > > > (defmodel Participant () > ((chat :cell nil :accessor chat-of :initarg :chat > :initform (error "Participants need something for its > `chat'-slot.")) > > (username :cell nil :accessor username-of :initarg :username > :initform (error "CellsChat needs a `username'.")) > > (speech :cell :ephemeral :accessor speech-of :initarg :speech > :initform (c-in nil)))) > > > > (defmethod initialize-instance :after ((participant Participant) &key) > (push participant (participants-of (chat-of participant)))) > > > > (defobserver speech ((participant Participant)) > ;; `new-value' always refers to the slot `speech' > ;; since that is what we're observing > (when new-value > (dolist (participant (participants-of (chat-of participant))) > (format t "Update interface for '~A', appending: ~A~%" > (username-of participant) new-value)))) > > > > (defmethod say ((participant Participant) (what string)) > (setf (speech-of participant) > (concatenate 'string (username-of participant) ": " what > *newline*))) > > > > (defmodel Chat () > ((text-box :accessor text-box-of > :initform (c? (concatenate 'string > ;; conversation till now.. > (or .cache "") > ;; well, ok then - this is neat > O_o > (some 'speech-of > (participants-of self))))) > > (participants :accessor participants-of > :initform (c-in nil)))) > > > > (defun testChat () > (let* ((chat (make-instance 'Chat)) > (user1 (make-instance 'Participant :username "user1" :chat chat)) > (user2 (make-instance 'Participant :username "user2" :chat > chat))) > (say user1 "Hello, anyone here?") > (say user2 "Well hello there - I'm here :)") > (say user1 "Cool .. what's up?") > (say user2 "Just doing some Lisp-hacking -- you?") > (say user1 "Naaaw .. nothing; I'm kind of tired, so I'm just > sitting in the sun here listening to some music"))) > > > ..pretty darn cool :) yes, indeed, except for the bug I tricked Lars into copying. It was a new one on me, to tell you the truth. I am working on a write-up. Almost done, then I will post it here. The bug can be seen by printing out the contents of the text-box (supposedly a full log) at the end of the chat: user1: Hello, anyone here? user2: Well hello there - I'm here :) user2: Just doing some Lisp-hacking -- you? In brief, SOME and ephemerals do not play well together. New instances get pushed onto participants (the slot), so user appears before user1 in the list. Once user2 gets picked up by SOME, there is no dependency on user1 speech, so only user2 gets recorded. Recall that dependencies reflect only the most recent evaluation (uhhh--I think synapses are an exception, but I have started to wonder why . Anyway....). Deets to follow. Interestingly, I think this is the first case where the Lisp one might naturally write does not Just Work. This bothers me quite a bit -- it may be a Bad Sign. After I post the writeup I will be interested in what others think. kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Tue Jun 13 05:21:27 2006 From: kentilton at gmail.com (Ken Tilton) Date: Tue, 13 Jun 2006 01:21:27 -0400 Subject: [cells-devel] I think it's a bug [was SOME vs The Ephemerals] In-Reply-To: References: Message-ID: <448E4B57.1070508@gmail.com> Ken Tilton wrote: > If you have been following the drama, i broke Lars's chat log with > this rule (somewhat revised): > > (chat-log:accessor chat-log > :initform (c? (concatenate 'string > (or .cache "") > (some 'speech-of (participants-of self))))) > > SOME stops at the first non-nil speech, establishing no dependencies > on the speech of any participant farther down the "participants-of" list. > > This is a problem, because speech-of is an ephemeral. It gets set to > nil /without/ propagating after any non-nil value gets set and > propagated. That is what ephemerals are all about, and I think that > much is solid....... maybe not. We'll come back to this. Anyway, if > someone farther down the list now says something, the rule does not > run because it has no dependency on their speech. And the log misses > an entry. > > Now I could just call this a user error ("Hey, Kenny! No dependency, > no re-calc!") and wipe my hands of the whole mess, but I have been > doing Cells for ten years and I had to debug in the internals for the > first time in a lonnng time to figure this one out, so I think an > unwritten law is being violated: normal, healthy Lisp code should > transparently maintain dependencies automatically. > > deep background: if there is no way around this, so be it, we have an > entry for a "gotchas" FAQ. But one thing that ruins supercool > libraries is exactly this sort of violation of the principle of least > surprise. So I want to see if the above code can be made to work. > > What I was thinking (until just now) was that any time a rule > encountered an ephemeral, just after the ephemeral got reset, the rule > should be rerun just to establish dependencies, not for its value. The > code would be simple (famous last words): after resetting an > ephemeral, iterate over all dependents of the ephemeral and call their > rule, ignoring the return value. Weird, but I bet it works. > > The alternative is to implement the "reset ephemeral step" actually as > a proper datapulse in which the ephemeral is set to NIL. Full > propagation, including observers of the ephemeral. Boy, that sure > weakens the ephemerality metaphor. :) > > Thoughts? Meanwhile, I will canvas real-world uses of ephemeral cells > for inspiration. nah, that was too much like work. It was not just "track down ephemerals", it mean looking at every cell that used every ephemeral. to hell with it, I fell back on Deep Theory: the idea of an ephemeral is to revert after being set to a state prior to having been set. Seems to be that this SOME problem simply makes the point that not only must the value mediated be reset to NIL, but also that dependent Cells have the dependencies they had when the value was nil. That is almost a no-brainer now that I put it that way. Made the change (it was trivial), regression test ran without a complaint and the SOME bug went away without further fuss. Life is good, except I think I saw that non-nil initialization of an ephemeral did not work ... i thought that did work, though quite recently it was unsupported. Gotta look at that next. kenny -------------- next part -------------- A non-text attachment was scrubbed... Name: kentilton.vcf Type: text/x-vcard Size: 171 bytes Desc: not available URL: From kentilton at gmail.com Tue Jun 13 16:22:14 2006 From: kentilton at gmail.com (Ken Tilton) Date: Tue, 13 Jun 2006 12:22:14 -0400 Subject: [cells-devel] Chat Shocker! Message-ID: [I thought I better share this with the PyCells crowd because it raises so many interesting issues.] In our last episode, we changed the Cells engine to rerun any rule dependent on an ephemeral after resetting the ephemral to NIL, so that rule's dependencies would reflect the world with the ephemeral slot as NIL. ie, it was a consistency issue: before this, the dependencies looked as if the ephemeral was still "on" even after it had been cleared. Inconsistency bad! The obvious downside: the rule gets run a second time (inefficient) and god help anyone putting side effects in their rule. OK, save that on the stack. I turned next to something else I noticed while playing with Lars's chat example: if a chatter was instantiated with a non-nil speech value, that speech did not make it into the chat log. The reason is simple: make chat make chatter with speech "hello world" [speech is ephemeral, so it is gone now] push chatter on to chat participants the chat-log cell sees null speech for new participant The solution brings up a Cells profundity: It is hard to be a little bit Cells. In the extended code sample below, we arrange for a proxy "joiner" slot to be watched by a /rule/ for the participants of a chat. Now what happens is: make chat set chat joiner to be (list name opening-remark) the participants rule runs and sees a new participant. and creates it with the speech initialized to the opening remark the participants slot propagates to the chat log, which sees the opening remark in the speech slot of the new participant (yeahh!) now at long last propagation has ended, and we process the 'ephemeral-reset' queueu, clearing the speech of the new participant The moral is first that, yes, an instance coming into existence is extremely interesting when it comes to internal consistency of state -- damn, we have not just changed state but /new/ state. That moral in turn gets back to the larger issue of it being hard to be "a little bit Cells"; the more we express declaratively, the better our models will work. Now let's start to look at why the article thread includes the word "Shocker". When I implemented the above it did not work at first. The opening remarks made it into the log, but I lost the annotations "So-and-so has entered the chat." What happened? Hoist on my own petard! The rule I had written for accumulating the chat log expected /either/ a speech or a new participant or a departed participant. I had now "fixed" things so that the new participant and its new speech were all part of one state change to the world. Doh! OK, fix the dumb assumption: In the chat-log rule, look for anything: someone saying something, someone leaving, someone arriving, and check them all each time. Before I finsihed came the Shocker: omigod. What if two new participants get added at once? Or what if some state change propagates and causes two chat participants to exclaim "Omigod!"? Omigod. I cannot code (some 'speech (participants chat)). Omigod. Just as I have to check population changes /as well as/ speech acts, i have to check all speech acts!!!! You have no idea what I am yelling about, do you? The last bit means I never ever should have been stopping at the first non-nil speech anyway. It was me being smart saying to myself "I know how Cells works, i will stop at the first". Dumb. the whole idea of (a) declarative and (b) transparency is to write the obvious code: iterate over all participants collecting any speech. meaning the fix I made to ephemerals to rerun rules, as plausible as it sounds (thine dependencies shalt match thine state) would not have been necessary. I like plausibility, but running the rule a second time is downright scary, let alone inefficient and unforgiving (to renegades who modify state inside rules), so out it comes. The really neat thing is that I am not through. The chat example eneded with one participant leaving the chat. before I made 'participants' a rule, that was done with an application (setf (participants chat) (remove....)) When I changed participants to be a rule, i forgot to change the depart-chat code. It worked. I was stunned, because Cells enforces a discipline: ruled Cells shall get their values only from an invocation of the rule. Then I remembered. This came up a couple of days ago and when I checked the "discipline" discovered that this rule was enforced only if *c-debug* was bound to t. I guess my thinking was that, in this case, other qualities of Cells still work. We do know who to notify of the change. But I was still thinking about being mean and closing this loophole. Until now. i kinda like this. :) There /is/ a declarative solution (change 'joiners' semantics to admit of an opcode (:join or :depart), but come on, we can be a /little/ sloppy, right? :) Here is the latest chat code. test function ending "oops" manifests the problem, ending "ok" shows the fix. kt (defpackage #:tu-some-ephemeral-uhoh (:use :cl :utils-kt :cells :tu-cells)) (in-package #:tu-some-ephemeral-uhoh) (defparameter *newline* (princ-to-string #\Newline)) (defmodel cells-chat (family) ;; kids slot can be partcipants ((chat-log :initarg :chat-log :accessor chat-log :initform (let (last-chatters) (c? (prog1 (apply 'concatenate 'string (or .cache "") (append (bwhen (lost-chatters (set-difference last-chatters (^kids))) (list (format nil "~{~a~} has left the chat~a" (mapcar 'username lost-chatters) *newline*))) (bwhen (new-chatters (set-difference (^kids) last-chatters)) (list (format nil "~a has joined the chat~a" (mapcar 'username new-chatters) *newline*))) (loop for p in (^kids) nconcing (bwhen (s (speech p)) (list (username p) ": " s *newline*))))) (setf last-chatters (^kids)))))))) (defmodel chatter (model) ((username :cell nil :accessor username :initarg :username :initform (error "chatter needs a `username'.")) (speech :cell :ephemeral :initform (c-in nil) :initarg :speech :accessor speech))) (defun tu-cells::tu-ephemeral-oops () (cells-reset) (let* ((chat (make-instance 'cells-chat)) (lars (make-instance 'chatter :fm-parent chat :speech (c-in "Hi, my name is Lars") :username "Lars"))) (push lars (kids chat)) (setf (speech lars) "Is anybody in here?") (push (make-instance 'chatter :fm-parent chat :speech (c-in "Hi, my name is Kenny") :username "Kenny") (kids chat)) (setf (speech lars) "Hi, Kenny. Cells are different.") (setf (speech (car (kids chat))) "Hi, Lars. That's for sure. Takes a while to adjust.") (setf (speech lars) "OK, I'll keep plugging") (depart-chat lars) (print (chat-log chat)))) (defun depart-chat (chatter) (setf (kids (fm-parent chatter)) (remove chatter (kids (fm-parent chatter))))) #+test (tu-cells::tu-ephemeral-oops) ; ; PROBLEM: The log is missing the initial speeches, because the ephemerals got reset before ; the instance was added to the particiapnts list. Solution: bring instantiation ; within the larger dataflow by making instantiation happen inside a rule for kids. ; (defmodel joinable-able (cells-chat) ((joiners :cell :ephemeral :initform (c-in nil) :initarg :joiners :accessor joiners)) (:default-initargs ; ; SOLUTION: the initial speech will stay around until the entire state change ; propagation has completed, including updating the chat log which has ; a dependency on the chat 'kids'. The new chatter gets instantiated as ; part of this rule, which then propagates to the chat-log, which sees the ; speech. That is ephemeral, but ephemerals do not get reset until after ; all propagation in one datapulse (ephemeral reset has its own queueu). ; :kids (c? (the-kids (loop for (name opening-remark) in (^joiners) collecting (make-kid 'chatter :username name :speech (c-in opening-remark))) .cache)))) (defun join-chat (chat &rest names) (setf (joiners chat) (loop for n in names collecting (list n (format nil "Hi, my name is ~a" n)))) (subseq (kids chat) 0 (length names))) (defun tu-cells::tu-ephemeral-ok () (cells-reset) (let ((chat (make-instance 'joinable-able)) lars kenny) (setf lars (car (join-chat chat "Lars"))) (setf (speech lars) "Is anybody in here?") (setf kenny (car (join-chat chat "Kenny"))) (setf (speech lars) "Hi, Kenny. Cells are different.") (setf (speech kenny) "Hi, Lars. That's for sure. You seem to be coming up to speed nicely.") (setf (speech lars) "OK, I'll keep plugging") (depart-chat lars) (join-chat chat "Peter" "Paul" "Mary") (print (chat-log chat)) (values))) #+test (tu-cells::tu-ephemeral-ok) -------------- next part -------------- An HTML attachment was scrubbed... URL: From kentilton at gmail.com Tue Jun 13 18:32:40 2006 From: kentilton at gmail.com (Ken Tilton) Date: Tue, 13 Jun 2006 14:32:40 -0400 Subject: [cells-devel] Re: [PyCells] Chat Shocker! In-Reply-To: <5.1.1.6.0.20060613125625.01e94d60@sparrow.telecommunity.com> References: <5.1.1.6.0.20060613125625.01e94d60@sparrow.telecommunity.com> Message-ID: On 6/13/06, Phillip J. Eby wrote: > > At 12:22 PM 6/13/2006 -0400, Ken Tilton wrote: > >In the chat-log rule, look for anything: someone saying something, > someone > >leaving, someone arriving, and check them all each time. Before I > finsihed > >came the Shocker: omigod. What if two new participants get added at once? > >Or what if some state change propagates and causes two chat participants > >to exclaim "Omigod!"? Omigod. I cannot code (some 'speech (participants > >chat)). Omigod. Just as I have to check population changes /as well as/ > >speech acts, i have to check all speech acts!!!! You have no idea what I > >am yelling about, do you? > > I think I do. The problem is that you don't have "foreach" rules or > second-order events. Actually, I don't have /any/ Cells rules or syntax other than to create the Cells, classes, and observers. Inside a rule, one Just Writes Lisp. Someone once asked whether I had any such things as a special construct for iterating over a list, and I offered "some", which is a standard Lisp keyword. I pointed out that one of the big wins of Cells is precisely that one does not have to use special constructs to make the paradigm work -- that would weaken the system because then calling some 3rd-party library function that happens to visit other Cells would not establish dependencies. Never mind the hassle of forcing all /my/ library code to use Cells-ese to iterate over lists or just access variables. Make sense? Or did I misunderstand you? My mistake was simply trying to be too clever. I thought I knew how Cells worked. :) So I thought I could use SOME, which stops at the first non-nil value. That was dumb. yes, ephemerals get reset right away so only one can be /set/ at a time (since each set becomes a new moment in data-time), but Cells has evolved lately and ephemerals can start as non-nil or be ruled (hmm, I might have to test that last one ), so it is now possible for more than one ephemeral to hold a value during one "moment" as you say. Bots in a game might have a rule determining their speeches, and all decide to yell "Run away!" at the moment a rabbit appears. :) kenny In traditional rule-driven systems, you can > effectively say "for each X and Y that meet criterion Z, do A(X,Y)". If I > understand correctly, the only way to do this in Cells would be to put a > collection in a cell and then have a rule that created a collection of > corresponding objects from it, or at least transformed any changes in the > collection into ephemeral add/remove events. > > In other words, Cells itself only deals with first-order (zeroth order?) > changes to values and objects. It does not deal with *sets* of values or > objects. It seems to me that this is the underlying nature of the problem > you encountered. > > Probably the simplest way to solve it in the general case is with a stock > object that transforms a collection into plural add/remove events. Even > better, two of them: one that monitors a cell with a collection, and the > other an object that looks like a collection but exposes event > cells. These would be roughly equivalent to rule cells and input cells, > respectively, but for collections of values instead of individual ones. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfb at ocf.berkeley.edu Wed Jun 14 09:25:29 2006 From: tfb at ocf.berkeley.edu (Thomas F. Burdick) Date: Wed, 14 Jun 2006 11:25:29 +0200 Subject: [cells-devel] I think it's a bug [was SOME vs The Ephemerals] In-Reply-To: <448E4B57.1070508@gmail.com> References: <448E4B57.1070508@gmail.com> Message-ID: On 6/13/06, Ken Tilton wrote: > Ken Tilton wrote: > > Thoughts? Meanwhile, I will canvas real-world uses of ephemeral cells > > for inspiration. > > nah, that was too much like work. It was not just "track down > ephemerals", it mean looking at every cell that used every ephemeral. Whew, you scared me there for a minute. From kentilton at gmail.com Wed Jun 14 15:11:01 2006 From: kentilton at gmail.com (Ken Tilton) Date: Wed, 14 Jun 2006 11:11:01 -0400 Subject: [cells-devel] Re: eager and lazy (brief) In-Reply-To: <000f01c68fbf$3faac700$0d00a8c0@Schmazelshmox> References: <000f01c68fbf$3faac700$0d00a8c0@Schmazelshmox> Message-ID: On 6/14/06, Andrew K. Wolven wrote: > > Do you know of any "gotcha"s for mixing eager and lazy evaluation of > attributes? No, but I do not use them much? I cc'ed the list because I believe Thomas uses them and he might have more experience. Do you have a specific scenario in mind that might be problematic? I can stare at the code and give you a rough guess. kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From luismbo at gmail.com Thu Jun 15 18:22:40 2006 From: luismbo at gmail.com (=?ISO-8859-1?Q?Lu=EDs_Oliveira?=) Date: Thu, 15 Jun 2006 19:22:40 +0100 Subject: [cells-devel] Minor Celtk/Togl woes Message-ID: <482E5692-8CC0-4F69-8F09-39885BC89764@gmail.com> Hello, First off, I hope this is the right mailing list for Celtk issues. The first issue was easy. gui-geometry is missing an .asd file. (Attached is a simple .asd for it.) The second issue is that building Togl requires private Tcl/Tk headers that don't come with OSX's Tcl/Tk frameworks. This probably wan't the best way to do it but here's what I did: => Downloaded the Tcl distribution from http://www.opensource.apple.com/darwinsource/ => Copied the tk/tk8.4.7/generic/*.h and tk/tk8.4.7/macosx/*.h headers to /System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/ => make. Copied libTogl1.7.dylib to /usr/lib => Changed togl.lisp's define-foreign-library. (patch attached) => Changed the pathnames that were pointing at c:\0dev\Celtk (patch attached) After this I can see spinning gears (though I can't seem to change their spinning speed) and lotsa widgets including a picture from back when Portugal was under a dictatorship and my parents didn't know each other. :-) Btw, Togl's CVS version (2.0 to be, apparently) doesn't have the following functions defined in togl.lisp: Togl_CreateFunc(), Togl_DisplayFunc(), Togl_ReshapeFunc(), Togl_DestroyFunc() and Togl_TimerFunc(). What's up with that? -- Lu?s Oliveira http://student.dei.uc.pt/~lmoliv/ -------------- next part -------------- A non-text attachment was scrubbed... Name: gui-geometry.asd Type: application/octet-stream Size: 383 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: celtk.patch Type: application/octet-stream Size: 3182 bytes Desc: not available URL: -------------- next part -------------- From luismbo at gmail.com Thu Jun 15 20:46:01 2006 From: luismbo at gmail.com (=?ISO-8859-1?Q?Lu=EDs_Oliveira?=) Date: Thu, 15 Jun 2006 21:46:01 +0100 Subject: [cells-devel] Minor Celtk/Togl woes In-Reply-To: <340F4FBE-1072-4761-A003-AEF85C35DD26@mac.com> References: <482E5692-8CC0-4F69-8F09-39885BC89764@gmail.com> <340F4FBE-1072-4761-A003-AEF85C35DD26@mac.com> Message-ID: On 2006-jun-15, at 20:58, Frank Goenninger wrote: >> Btw, Togl's CVS version (2.0 to be, apparently) doesn't have the >> following functions defined in togl.lisp: Togl_CreateFunc(), >> Togl_DisplayFunc(), Togl_ReshapeFunc(), Togl_DestroyFunc() and >> Togl_TimerFunc(). What's up with that? > > Hunh? Which CVS do you access? http://sourceforge.net/cvs/?group_id=519 The CVS repository has some 2 weeks old changes so I guess it's not too dead. Looking at the two gears.c examples, the interface changed from: Togl_CreateFunc(init); Togl_DestroyFunc(zap); Togl_DisplayFunc(draw); Togl_ReshapeFunc(reshape); Togl_TimerFunc(idle); Togl_CreateCommand("rotate", rotate); Togl_CreateCommand("position", position); to: Tcl_CreateObjCommand(interp, "init", init, NULL, NULL); Tcl_CreateObjCommand(interp, "zap", zap, NULL, NULL); Tcl_CreateObjCommand(interp, "draw", draw, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape", reshape, NULL, NULL); Tcl_CreateObjCommand(interp, "idle", idle, NULL, NULL); Tcl_CreateObjCommand(interp, "rotate", rotate, NULL, NULL); Tcl_CreateObjCommand(interp, "position", position, NULL, NULL); -- Lu?s Oliveira http://student.dei.uc.pt/~lmoliv/ From fgoenninger at prion.de Fri Jun 16 07:07:27 2006 From: fgoenninger at prion.de (Frank Goenninger) Date: Fri, 16 Jun 2006 09:07:27 +0200 Subject: [cells-devel] Minor Celtk/Togl woes In-Reply-To: References: <482E5692-8CC0-4F69-8F09-39885BC89764@gmail.com> <340F4FBE-1072-4761-A003-AEF85C35DD26@mac.com> Message-ID: Am 15.06.2006 um 22:46 schrieb Lu?s Oliveira: > On 2006-jun-15, at 20:58, Frank Goenninger wrote: >>> Btw, Togl's CVS version (2.0 to be, apparently) doesn't have the >>> following functions defined in togl.lisp: Togl_CreateFunc(), >>> Togl_DisplayFunc(), Togl_ReshapeFunc(), Togl_DestroyFunc() and >>> Togl_TimerFunc(). What's up with that? >> >> Hunh? Which CVS do you access? > > http://sourceforge.net/cvs/?group_id=519 > > The CVS repository has some 2 weeks old changes so I guess it's not > too dead. Looking at the two gears.c examples, the interface > changed from: > > Togl_CreateFunc(init); > Togl_DestroyFunc(zap); > Togl_DisplayFunc(draw); > Togl_ReshapeFunc(reshape); > Togl_TimerFunc(idle); > Togl_CreateCommand("rotate", rotate); > Togl_CreateCommand("position", position); > > to: > > Tcl_CreateObjCommand(interp, "init", init, NULL, NULL); > Tcl_CreateObjCommand(interp, "zap", zap, NULL, NULL); > Tcl_CreateObjCommand(interp, "draw", draw, NULL, NULL); > Tcl_CreateObjCommand(interp, "reshape", reshape, NULL, NULL); > Tcl_CreateObjCommand(interp, "idle", idle, NULL, NULL); > Tcl_CreateObjCommand(interp, "rotate", rotate, NULL, NULL); > Tcl_CreateObjCommand(interp, "position", position, NULL, NULL); Ah, right. That change in the interface had been announced some months ago. It's just that Celtk has to change to the "obj" interface now, too. Some homework to do here ;-) Cheers, Frank From kentilton at gmail.com Sat Jun 17 18:59:52 2006 From: kentilton at gmail.com (Ken Tilton) Date: Sat, 17 Jun 2006 14:59:52 -0400 Subject: [cells-devel] Re: [PyCells] Thoughts after porting the first 6 tutorial sections In-Reply-To: References: <8DECDBF0-7BD2-4EF8-A9DA-298E65512A94@cs.uoregon.edu> <0C0C47F6-0B45-4EBA-968A-5D2BB2651897@cs.uoregon.edu> Message-ID: On 6/17/06, Ken Tilton wrote: > > > > On 6/16/06, Ryan Forsythe wrote: > > > > > On Jun 16, 2006, at 2:43 PM, Ken Tilton wrote: > > > I downloaded it and it has the right size, but PicoZip (which > > > normally does fine with tars and tgzs (but not always)) finds > > > nothing to extract. > > > > Weird. I've uploaded a zip of the export, maybe that'll work for > > picozip: http://pycells.pyworks.org/pycells-r12.zip > > > Thanks, that worked. > > One quick reaction: in Cells, observers are more clasically OO, they are > defined as a class attribute. I am not sure if PyCells is doing the same > after a quick glance, but I do see that the Cell data structure has a slot > for observers, which sounds as if in PyCells they might be Cell-specific. > Correct me if I am wrong. > I forgot to mention something (and I am CCing cells-devel to see what others think): the idea of instance/slot-specific observers does not seem like a bad idea. It certainly is consistent with Cells allowing different rules for the same slot of different instances. Normal observers really do have to be class-oriented (it does not how a color of a widget gets decided, a change still has to trigger an OS update) but if PyCells happens to support instance/slot-specific observers that would be OK. The only problem I see is that you need a little new syntax. I suppose in Cells it would be: (c-formua (:observer (observer-lambda () ......)...) Does anyone recall ever needing an instance-specific observer? kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgoenninger at prion.de Sat Jun 17 20:32:15 2006 From: fgoenninger at prion.de (Frank Goenninger) Date: Sat, 17 Jun 2006 22:32:15 +0200 Subject: [cells-devel] Re: [PyCells] Thoughts after porting the first 6 tutorial sections In-Reply-To: References: <8DECDBF0-7BD2-4EF8-A9DA-298E65512A94@cs.uoregon.edu> <0C0C47F6-0B45-4EBA-968A-5D2BB2651897@cs.uoregon.edu> Message-ID: <7ADB6EB2-1C4F-4478-AAB4-1E6A18E9F51F@prion.de> Am 17.06.2006 um 20:59 schrieb Ken Tilton: > Does anyone recall ever needing an instance-specific observer? > > kt Actually, yes, I do. I implemented that with dispatching against the model name ( the :id of the instance). So, it can be done already, but a separate syntax may be helpful (and more clear). My 0.02 EUR. ;-) Frank From kentilton at gmail.com Sat Jun 17 20:54:16 2006 From: kentilton at gmail.com (Ken Tilton) Date: Sat, 17 Jun 2006 16:54:16 -0400 Subject: [cells-devel] Re: [PyCells] Thoughts after porting the first 6 tutorial sections In-Reply-To: <7ADB6EB2-1C4F-4478-AAB4-1E6A18E9F51F@prion.de> References: <8DECDBF0-7BD2-4EF8-A9DA-298E65512A94@cs.uoregon.edu> <0C0C47F6-0B45-4EBA-968A-5D2BB2651897@cs.uoregon.edu> <7ADB6EB2-1C4F-4478-AAB4-1E6A18E9F51F@prion.de> Message-ID: On 6/17/06, Frank Goenninger wrote: > > > Am 17.06.2006 um 20:59 schrieb Ken Tilton: > > > Does anyone recall ever needing an instance-specific observer? > > > > kt > > Actually, yes, I do. I implemented that with dispatching against the > model name ( the :id of the instance). So, it can be done already, > but a separate syntax may be helpful (and more clear). Thx for the input. Can you share the semantics of the slot? Name, usage, the actual observer, any rules on the slot, etc, etc? kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From rkm1000 at bmrc.duhs.duke.edu Mon Jun 19 20:50:18 2006 From: rkm1000 at bmrc.duhs.duke.edu (Ken McKee) Date: Mon, 19 Jun 2006 16:50:18 -0400 Subject: [cells-devel] removing an instance from a dependency Message-ID: <052FEB47-D91B-47B6-A667-50F21B537471@bmrc.mc.duke.edu> Hello, Suppose I have three instances of cells enabled classes. Two instances depend on the third. Now suppose I want to dispose of one the dependent instances. Below one dependent instance is "named" "bar1" and the other is "named" "bar2". How would I dispose of one or both of these instances? Thanks, Ken Mckee APP(3): (defmodel some-model () ((a-slot :initform (c-in nil) :accessor a-slot :cell t) )) # APP(4): (defmodel another-model () ((a-slot :cell t :accessor a-slot :initarg :a-slot) (name :cell nil :accessor name :initarg :name) )) # APP(5): (setf foo (make-instance 'some-model)) # APP(6): (setf bar (make-instance 'another-model :name "bar1" :a-slot (c? (print (name self)) (a-slot foo)) )) # APP(7): (a-slot bar) "bar1" NIL APP(8): (setf bar (make-instance 'another-model :name "bar2" :a-slot (c? (print (name self)) (a-slot foo)) )) # APP(9): (a-slot bar) "bar2" NIL APP(10): (setf (a-slot foo) 5) "bar2" "bar1" 5 From kentilton at gmail.com Fri Jun 23 01:43:53 2006 From: kentilton at gmail.com (Ken Tilton) Date: Thu, 22 Jun 2006 21:43:53 -0400 Subject: [cells-devel] Cells Has Been Validated Message-ID: Actually I am just trying to trigger gmane picking up cells-devel. Meanwhile, over on the SoC PyCells project they a feedfest started as everyone tore the algorithm apart (and started their own version of Cells). The group decided Cells was OK. Oh, yeah. I finally fixed defclass. There is now an abbreviated defmodel, DEFMD: (defmd defmd-test (md-test-super) (aaa :cell nil :initform nil :initarg :aaa :accessor aaa) ;; defmd would have written the same on just "aaa" (aa2 :documentation "hi mom") ;; expands into all-the-above bbb ;; same as aaa (ccc 42 :allocation :class) ;; if second arg is not slot def keyword, it is an :initform. (ddd (c-in nil) :cell :ephemeral) :superx 42 ;; default-initarg (:documentation "as if!")) kt -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfb at ocf.berkeley.edu Fri Jun 23 05:26:06 2006 From: tfb at ocf.berkeley.edu (Thomas F. Burdick) Date: Fri, 23 Jun 2006 07:26:06 +0200 Subject: [cells-devel] Cells Has Been Validated In-Reply-To: References: Message-ID: On 6/23/06, Ken Tilton wrote: > Oh, yeah. I finally fixed defclass. There is now an abbreviated defmodel, > DEFMD: > > (defmd defmd-test (md-test-super) > (aaa :cell nil :initform nil :initarg :aaa :accessor aaa) ;; defmd would > have written the same on just "aaa" FIXED?!?! Aren't a lot of problems with Cells traceable to using :cell nil, because either someone thought "okay this one is an exception" or as an efficiency hack? Certainly accidentally non-Cell slots have caused me no end of grief when I run into them. I've gotten to the point of viewing :cell nil as a hack that's occasionally necessary when either (a) I'm not able to fit some behavior into the Cells model, or (b) the Cells model turns out to have a shortcomming that needs to be fixed, but in the meantime we have a work-around. Given that, I'm not supporting :cell nil at all in C4 (and C4-other-lisps); you can get the same effect by putting the slots in a defclass and using it as a mixin, and that way you won't be under any illusions that what you're doing is generally a good idea. From kentilton at gmail.com Fri Jun 23 10:36:48 2006 From: kentilton at gmail.com (Ken Tilton) Date: Fri, 23 Jun 2006 06:36:48 -0400 Subject: [cells-devel] Cells Has Been Validated In-Reply-To: References: Message-ID: On 6/23/06, Thomas F. Burdick wrote: > > On 6/23/06, Ken Tilton wrote: > > Oh, yeah. I finally fixed defclass. There is now an abbreviated > defmodel, > > DEFMD: > > > > (defmd defmd-test (md-test-super) > > (aaa :cell nil :initform nil :initarg :aaa :accessor aaa) ;; defmd > would > > have written the same on just "aaa" > > FIXED?!?! > > Aren't a lot of problems with Cells traceable to using :cell nil, Wouldn't know; never use it. :) Well, I found a few. The keyboard accelerator for a widget. God help the user if those start changing according to program state. Also a cache of the window at the top of the gui hierarchy. It's a pretty quick trip up the tree to do that functionally, but why not save the result? Make it a cell and it has to be an input, dependencies pop up all over. because either someone thought "okay this one is an exception" or as > an efficiency hack? Certainly accidentally non-Cell slots have caused > me no end of grief when I run into them. Amazing. I never had a problem. What happens is that I finally try to apply a cell to one and the internals say, "what are you doing? I see a cell initializer for a non-cell slot." (Not sure that safeguard is still in there tho.) To the extent my bet was correct ("who would ever want to use a cell for /this/?!") the risk of accidentally trying to use a cell goes down commensurately. I've gotten to the point of viewing :cell nil as a hack that's > occasionally necessary when either (a) I'm not able to fit some > behavior into the Cells model, or (b) the Cells model turns out to > have a shortcomming that needs to be fixed, but in the meantime we > have a work-around. Given that, I'm not supporting :cell nil at all > in C4 (and C4-other-lisps); Question: do you even /look/ at Cells code any more? Phillip Eby over on PyCells is now fleshing out his dataflow package, and we unearthed another Pythonista who had some DF code but got motivated by Cells to formalize it into a proper package. My other question: what do we call the annual conference, and where do we hold it? Dataflow 2007? Gotta get the KR and COSI people, too. I propose not having any talks, so there is more time for drinking. Maybe we could label the clusters of drinkers as to the dataflow topic they happen to be on. Need some electronic signage.... kt -------------- next part -------------- An HTML attachment was scrubbed... URL: