From pcn at pogt.dk Sat May 16 14:23:41 2009 From: pcn at pogt.dk (Peder Chr. =?iso-8859-1?q?N=F8rgaard?=) Date: Sat, 16 May 2009 16:23:41 +0200 Subject: [cells-devel] A question about the use of vectors in CELLS Message-ID: <200905161623.41897.pcn@pogt.dk> Hello I am attempting to use a vector as the value in a slot. It does not work well in first attempt: CL-USER> (use-package :cells) T CL-USER> (defparameter a1 (make-instance 'model :value (c-in #(1 2 3 4)))) A1 CL-USER> (defparameter a2 (make-instance 'model :value (c? (apply #'+ (map 'list #'identity (value a1)))))) A2 CL-USER> (value a2) 10 CL-USER> (setf (elt (value a1) 1) 5) 5 CL-USER> (value a1) #(1 5 3 4) CL-USER> (value a2) 10 The VALUE slot of A2, depending on (VALUE A1) is not changing when (VALUE A1) is, shall we call it "changed in place". The cells version is from :pserver:anonymous:anonymous at common-lisp.net:/project/cells/cvsroot. The Lisp system is SBCL is 1.0.18.0-2. I would like to enquire whether I am simply doing something trivially wrong, or whether this is something that simply cannot be done without a major CELLS extension for support of vector values (like, FAMILY, can be viewed as a kind of support for list values). The latter answer may force me to reconsider an implementation that I had in mind. Thank you in advance for any information -- Peder Chr. N?rgaard e-mail: pcn at pogt.dk Gefionsvej 19 DK-8230 ?byh?j tel: +45 87 44 11 99 Denmark mob: +45 30 91 84 31 From kentilton at gmail.com Sat May 16 20:30:31 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Sat, 16 May 2009 16:30:31 -0400 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <200905161623.41897.pcn@pogt.dk> References: <200905161623.41897.pcn@pogt.dk> Message-ID: <4A0F2267.7000806@gmail.com> Peder Chr. N?rgaard wrote: > Hello > > I am attempting to use a vector as the value in a slot. It does not > work well in first attempt: > > CL-USER> (use-package :cells) > T > CL-USER> (defparameter a1 (make-instance 'model :value (c-in #(1 2 3 4)))) > A1 > CL-USER> (defparameter a2 (make-instance 'model :value (c? (apply #'+ > (map 'list #'identity (value a1)))))) > A2 > CL-USER> (value a2) > 10 > CL-USER> (setf (elt (value a1) 1) 5) > 5 > CL-USER> (value a1) > #(1 5 3 4) > CL-USER> (value a2) > 10 > > The VALUE slot of A2, depending on (VALUE A1) is not changing when (VALUE A1) > is, shall we call it "changed in place". > > The cells version is > from :pserver:anonymous:anonymous at common-lisp.net:/project/cells/cvsroot. > > The Lisp system is SBCL is 1.0.18.0-2. > > I would like to enquire whether I am simply doing something trivially wrong, > or whether this is something that simply cannot be done without a major CELLS > extension for support of vector values (like, FAMILY, can be viewed as a kind > of support for list values). The latter answer may force me to reconsider an > implementation that I had in mind. You are not doing anything wrong. As you guessed, you would need to extend Cells, but not all that much. Peter Hildebrandt did this for hash tables IIRC. Something about "store". I suppose you are aware you could get by with Cells as it is if you could afford to do a copy-seq on the value each time so Cells could see something change. kt From larry at theclapp.org Sun May 17 22:05:49 2009 From: larry at theclapp.org (Larry Clapp) Date: Sun, 17 May 2009 18:05:49 -0400 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <200905161623.41897.pcn@pogt.dk> References: <200905161623.41897.pcn@pogt.dk> Message-ID: <20090517220549.GD14246@cupid.theclapp.org> On Sat, May 16, 2009 at 04:23:41PM +0200, Peder Chr. N?rgaard wrote: > I am attempting to use a vector as the value in a slot. It does not > work well in first attempt: > > CL-USER> (use-package :cells) > T > CL-USER> (defparameter a1 (make-instance 'model :value (c-in #(1 2 3 4)))) > A1 > CL-USER> (defparameter a2 (make-instance 'model :value (c? (apply #'+ > (map 'list #'identity (value a1)))))) > A2 > CL-USER> (value a2) > 10 > CL-USER> (setf (elt (value a1) 1) 5) > 5 > CL-USER> (value a1) > #(1 5 3 4) > CL-USER> (value a2) > 10 > > The VALUE slot of A2, depending on (VALUE A1) is not changing when > (VALUE A1) is, shall we call it "changed in place". > > The cells version is > from :pserver:anonymous:anonymous at common-lisp.net:/project/cells/cvsroot. > > The Lisp system is SBCL is 1.0.18.0-2. > > I would like to enquire whether I am simply doing something > trivially wrong, or whether this is something that simply cannot be > done without a major CELLS extension for support of vector values > (like, FAMILY, can be viewed as a kind of support for list values). > The latter answer may force me to reconsider an implementation that > I had in mind. I asked a similar question almost exactly a year ago. Hmmm. :) Anyway, see http://common-lisp.net/pipermail/cells-devel/2008-May/002035.html . The general answer hasn't changed since then: either don't do that, or recons the sequence, or make the cell formula depend on something else that changes directly in addition to the stuff it actually depends on. (In last year's thread, Peter Hildebrandt noted that this last option is how cells-store works.) I played with the last option a bit today, and came up with this (which may or may not work very well in real usage, but the toy example below works): (defmodel change-counter () ((count :initform (c-in 0) :accessor count-of))) (defmethod kick ((self change-counter)) (incf (count-of self))) (defmacro change-watcher ((model) &body body) `(progn (count-of ,model) , at body)) (defmacro with-changes ((&rest models) &body body) `(unwind-protect (progn , at body) (with-integrity (:change) (dolist (model (list , at models)) (kick model))))) Example (Lispworks, if it matters): CELLS-PLAY 217 > (defmodel test (change-counter) ((slot :initarg :slot :accessor slot-of))) NIL CELLS-PLAY 218 > (defparameter a1 (make-instance 'test :slot (c-in #(1 2 3 4)))) A1 CELLS-PLAY 219 > (defparameter a2 (make-instance 'test :slot (c? (change-watcher (a1) (format t "recalc a2's s~%") (apply '+ (coerce (slot-of a1) 'list)))))) recalc a2's s A2 CELLS-PLAY 220 > (slot-of a2) 10 CELLS-PLAY 221 > (with-changes (a1) (setf (aref (slot-of a1) 1) 5)) recalc a2's s 5 CELLS-PLAY 222 > (slot-of a2) 13 CELLS-PLAY 223 > (slot-of a1) #(1 5 3 4) Hope that's helpful. -- Larry From pcn at pogt.dk Mon May 18 15:48:44 2009 From: pcn at pogt.dk (Peder Chr. =?iso-8859-1?q?N=F8rgaard?=) Date: Mon, 18 May 2009 17:48:44 +0200 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <20090517220549.GD14246@cupid.theclapp.org> References: <200905161623.41897.pcn@pogt.dk> <20090517220549.GD14246@cupid.theclapp.org> Message-ID: <200905181748.44421.pcn@pogt.dk> Larry, thanks for the answer. Yes, a trick (OK, a technique) like this would probably do the job for me. I was kind of leaning in the same direction myself, Kenneth Tilton's response pointing to Peter Hildebrandt's "cells-store" extension which is actually a part of the Cells package that I am using and using more or less the same hack (OK, same technique) :-). So, everybody, thanks for your help, Kenneth, Jakub, Larry. And Peter Hildebrandt, I found the Aug 2008 mail describing the rationale for cells-store (not to be churlish, but that text ought to be in cells source code package, not in a mail somewhere. It is valuable!). I have the answer to my problem now. Just have to decide what to do. best regards --peder chr. On Monday 18 May 2009, Larry Clapp wrote: > On Sat, May 16, 2009 at 04:23:41PM +0200, Peder Chr. N?rgaard wrote: > > I am attempting to use a vector as the value in a slot. It does not > > work well in first attempt: > > > > CL-USER> (use-package :cells) > > T > > CL-USER> (defparameter a1 (make-instance 'model :value (c-in #(1 2 3 > > 4)))) A1 > > CL-USER> (defparameter a2 (make-instance 'model :value (c? (apply #'+ > > (map 'list #'identity (value a1)))))) > > A2 > > CL-USER> (value a2) > > 10 > > CL-USER> (setf (elt (value a1) 1) 5) > > 5 > > CL-USER> (value a1) > > #(1 5 3 4) > > CL-USER> (value a2) > > 10 > > > > The VALUE slot of A2, depending on (VALUE A1) is not changing when > > (VALUE A1) is, shall we call it "changed in place". > > > > The cells version is > > from > > :pserver:anonymous:anonymous at common-lisp.net:/project/cells/cvsroot. > > > > The Lisp system is SBCL is 1.0.18.0-2. > > > > I would like to enquire whether I am simply doing something > > trivially wrong, or whether this is something that simply cannot be > > done without a major CELLS extension for support of vector values > > (like, FAMILY, can be viewed as a kind of support for list values). > > The latter answer may force me to reconsider an implementation that > > I had in mind. > > I asked a similar question almost exactly a year ago. Hmmm. :) > Anyway, see > http://common-lisp.net/pipermail/cells-devel/2008-May/002035.html . > The general answer hasn't changed since then: either don't do that, or > recons the sequence, or make the cell formula depend on something else > that changes directly in addition to the stuff it actually depends on. > (In last year's thread, Peter Hildebrandt noted that this last option > is how cells-store works.) > > I played with the last option a bit today, and came up with this > (which may or may not work very well in real usage, but the toy > example below works): > > (defmodel change-counter () > ((count :initform (c-in 0) :accessor count-of))) > > (defmethod kick ((self change-counter)) > (incf (count-of self))) > > (defmacro change-watcher ((model) &body body) > `(progn > (count-of ,model) > , at body)) > > (defmacro with-changes ((&rest models) &body body) > `(unwind-protect > (progn , at body) > (with-integrity (:change) > (dolist (model (list , at models)) > (kick model))))) > > Example (Lispworks, if it matters): > > CELLS-PLAY 217 > (defmodel test (change-counter) > ((slot :initarg :slot :accessor slot-of))) > NIL > > CELLS-PLAY 218 > (defparameter a1 (make-instance 'test :slot (c-in #(1 2 > 3 4)))) A1 > > CELLS-PLAY 219 > (defparameter a2 (make-instance 'test :slot (c? > (change-watcher (a1) > (format t "recalc a2's s~%") > (apply '+ (coerce (slot-of a1) 'list)))))) > recalc a2's s > A2 > > CELLS-PLAY 220 > (slot-of a2) > 10 > > CELLS-PLAY 221 > (with-changes (a1) > (setf (aref (slot-of a1) 1) 5)) > recalc a2's s > 5 > > CELLS-PLAY 222 > (slot-of a2) > 13 > > CELLS-PLAY 223 > (slot-of a1) > #(1 5 3 4) > > Hope that's helpful. > > -- Larry -- Peder Chr. N?rgaard e-mail: pcn at pogt.dk Gefionsvej 19 DK-8230 ?byh?j tel: +45 87 44 11 99 Denmark mob: +45 30 91 84 31 From kentilton at gmail.com Mon May 18 16:12:40 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Mon, 18 May 2009 12:12:40 -0400 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <200905181748.44421.pcn@pogt.dk> References: <200905161623.41897.pcn@pogt.dk> <20090517220549.GD14246@cupid.theclapp.org> <200905181748.44421.pcn@pogt.dk> Message-ID: <4A1188F8.4010703@gmail.com> FWIW: Probably the most elegant answer would be one in which one could rely on just one element of a vector, although I can also see how one would then need a way to have just one dependency if one was iterating over the whole vector. This would prolly mean a whole new entry point (md-slot-vector-value and (setf md-slot-vector-value)) and in the end not be all that hard, just some straightforward effort in the dependency-tracking code to keep it efficient. This would not be transparent or foolproof -- if one forgets to use the slot-vector API the dependencies will mysteriously not work, but that is the kind of thing one recognizes after ten seconds of stunned astonishment (like CLOS methods whose signatures I change but neglect to expunge). kt Peder Chr. N?rgaard wrote: > Larry, thanks for the answer. Yes, a trick (OK, a technique) like this would > probably do the job for me. I was kind of leaning in the same direction > myself, Kenneth Tilton's response pointing to Peter > Hildebrandt's "cells-store" extension which is actually a part of the Cells > package that I am using and using more or less the same hack (OK, same > technique) :-). > > So, everybody, thanks for your help, Kenneth, Jakub, Larry. And Peter > Hildebrandt, I found the Aug 2008 mail describing the rationale for > cells-store (not to be churlish, but that text ought to be in cells source > code package, not in a mail somewhere. It is valuable!). > > I have the answer to my problem now. Just have to decide what to do. > > best regards > --peder chr. > > > > On Monday 18 May 2009, Larry Clapp wrote: >> On Sat, May 16, 2009 at 04:23:41PM +0200, Peder Chr. N?rgaard wrote: >>> I am attempting to use a vector as the value in a slot. It does not >>> work well in first attempt: >>> >>> CL-USER> (use-package :cells) >>> T >>> CL-USER> (defparameter a1 (make-instance 'model :value (c-in #(1 2 3 >>> 4)))) A1 >>> CL-USER> (defparameter a2 (make-instance 'model :value (c? (apply #'+ >>> (map 'list #'identity (value a1)))))) >>> A2 >>> CL-USER> (value a2) >>> 10 >>> CL-USER> (setf (elt (value a1) 1) 5) >>> 5 >>> CL-USER> (value a1) >>> #(1 5 3 4) >>> CL-USER> (value a2) >>> 10 >>> >>> The VALUE slot of A2, depending on (VALUE A1) is not changing when >>> (VALUE A1) is, shall we call it "changed in place". >>> >>> The cells version is >>> from >>> :pserver:anonymous:anonymous at common-lisp.net:/project/cells/cvsroot. >>> >>> The Lisp system is SBCL is 1.0.18.0-2. >>> >>> I would like to enquire whether I am simply doing something >>> trivially wrong, or whether this is something that simply cannot be >>> done without a major CELLS extension for support of vector values >>> (like, FAMILY, can be viewed as a kind of support for list values). >>> The latter answer may force me to reconsider an implementation that >>> I had in mind. >> I asked a similar question almost exactly a year ago. Hmmm. :) >> Anyway, see >> http://common-lisp.net/pipermail/cells-devel/2008-May/002035.html . >> The general answer hasn't changed since then: either don't do that, or >> recons the sequence, or make the cell formula depend on something else >> that changes directly in addition to the stuff it actually depends on. >> (In last year's thread, Peter Hildebrandt noted that this last option >> is how cells-store works.) >> >> I played with the last option a bit today, and came up with this >> (which may or may not work very well in real usage, but the toy >> example below works): >> >> (defmodel change-counter () >> ((count :initform (c-in 0) :accessor count-of))) >> >> (defmethod kick ((self change-counter)) >> (incf (count-of self))) >> >> (defmacro change-watcher ((model) &body body) >> `(progn >> (count-of ,model) >> , at body)) >> >> (defmacro with-changes ((&rest models) &body body) >> `(unwind-protect >> (progn , at body) >> (with-integrity (:change) >> (dolist (model (list , at models)) >> (kick model))))) >> >> Example (Lispworks, if it matters): >> >> CELLS-PLAY 217 > (defmodel test (change-counter) >> ((slot :initarg :slot :accessor slot-of))) >> NIL >> >> CELLS-PLAY 218 > (defparameter a1 (make-instance 'test :slot (c-in #(1 2 >> 3 4)))) A1 >> >> CELLS-PLAY 219 > (defparameter a2 (make-instance 'test :slot (c? >> (change-watcher (a1) >> (format t "recalc a2's s~%") >> (apply '+ (coerce (slot-of a1) 'list)))))) >> recalc a2's s >> A2 >> >> CELLS-PLAY 220 > (slot-of a2) >> 10 >> >> CELLS-PLAY 221 > (with-changes (a1) >> (setf (aref (slot-of a1) 1) 5)) >> recalc a2's s >> 5 >> >> CELLS-PLAY 222 > (slot-of a2) >> 13 >> >> CELLS-PLAY 223 > (slot-of a1) >> #(1 5 3 4) >> >> Hope that's helpful. >> >> -- Larry > > > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.329 / Virus Database: 270.12.32/2118 - Release Date: 05/16/09 17:05:00 > From kentilton at gmail.com Mon May 18 16:37:53 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Mon, 18 May 2009 12:37:53 -0400 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <2D51E4F8-83DD-46DA-B57B-CEB3689C548B@mac.com> References: <200905161623.41897.pcn@pogt.dk> <20090517220549.GD14246@cupid.theclapp.org> <200905181748.44421.pcn@pogt.dk> <4A1188F8.4010703@gmail.com> <2D51E4F8-83DD-46DA-B57B-CEB3689C548B@mac.com> Message-ID: <4A118EE1.1030907@gmail.com> Frank Goenninger wrote: > It just occurred to me that a simple :unchanged-if function should do > the trick, no ? That is always my first reaction, too. Two problems: Cells works off (setf slot-value) if you will, and no code goes through that on (setf aref). The second problem is almost the same. Even this sequence: (setf (aref (myvector self) 42) 'hi-mom) (setf (myvector self) (myvector self)) ;; to get to unchanged-if ...would not work because Cells saves the slot-value for comparison and in this case before and after are the same vector -- so the old element 42 of course now holds 'hi-mom. kt From kentilton at gmail.com Mon May 18 16:52:47 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Mon, 18 May 2009 12:52:47 -0400 Subject: [cells-devel] A question about the use of vectors in CELLS In-Reply-To: <4A118EE1.1030907@gmail.com> References: <200905161623.41897.pcn@pogt.dk> <20090517220549.GD14246@cupid.theclapp.org> <200905181748.44421.pcn@pogt.dk> <4A1188F8.4010703@gmail.com> <2D51E4F8-83DD-46DA-B57B-CEB3689C548B@mac.com> <4A118EE1.1030907@gmail.com> Message-ID: <4A11925F.1020707@gmail.com> Kenneth Tilton wrote: > > Frank Goenninger wrote: >> It just occurred to me that a simple :unchanged-if function should do >> the trick, no ? > > That is always my first reaction, too. Two problems: Cells works off > (setf slot-value) if you will, and no code goes through that on (setf > aref). The second problem is almost the same. Even this sequence: > > (setf (aref (myvector self) 42) 'hi-mom) > (setf (myvector self) (myvector self)) ;; to get to unchanged-if > > ...would not work because Cells saves the slot-value for comparison and > in this case before and after are the same vector -- so the old element > 42 of course now holds 'hi-mom. er, because it is not "old", it is the same as in EQ vector. kt From marcoxa at cs.nyu.edu Wed May 20 13:51:44 2009 From: marcoxa at cs.nyu.edu (Marco Antoniotti) Date: Wed, 20 May 2009 15:51:44 +0200 Subject: [cells-devel] [ELS 2009] Call for participation Message-ID: <000D2AAE-FDA1-4B77-B328-76C2D33DF258@cs.nyu.edu> Apologies for multiple postings.... ************************************************************************ 2nd European Lisp Symposium (ELS 2009) Milan, Italy, May 27-29, 2009 Universita` degli Studi di Milano-Bicocca www.european-lisp-symposium.org ************************************************************************ CALL FOR PARTICIPATION ********************** REGISTRATION IS OPEN AT www.european-lisp-symposium.org. Check out the updated program. Scope and Program Highlights: ***************************** The purpose of the European Lisp Symposium is to provide a forum for the discussion of all aspects of the design, implementation and application of any of the Lisp dialects. We encourage everyone interested in Lisp to participate. The European Lisp Symposium 2009 program includes presentations of high quality papers about novel research results, insights and lessons learned from practical applications, and educational perspectives, all involving Lisp dialects, including Common Lisp, Scheme, Emacs Lisp, AutoLisp, ISLISP, Dylan, Clojure, and so on. The European Lisp Symposium will feature the following highlights: - Scott McKay of ITA Software will talk about how Lisp use has evolved in his circannual industry work. - Mark Tarver of Lambda Associates will talk about Qi as a viral mutation of the Lisp DNA. - Mauro Pezze` of University of Milan-Bicocca will host a panel on Programmers' Productivity from a Software Engineering point of view. - Joao Pavao Martins and Ernesto Morgado of SISCOG will talk about the role of LISP in the success of SISCOG - Christophe Rhodes will give an unportable tutorial. - Michele Simionato will give a tutorial on Scheme module system and Scheme libraries portability issues across implementations. Social Events: ************** Friday 29th evening, Conference Banquet Saturday 30th morning, Guided tour to the "Futurismo" Exhibit in the center of Milan; 2009 marks the 100th anniversary of the Futurism Manifesto; stretching it, the harbinger of Lisp 50 years later. Program Chair: ************** * Antonio Leitao, Technical University of Lisbon, Portugal Local Chair: ************ * Marco Antoniotti, DISCo, Universita`? Milano Bicocca, Italy Program committee: ****************** * Giuseppe Attardi, Universita` di Pisa , Italy * Pascal Costanza, Vrije Universiteit Brussel, Belgium * Irene Durand, Universite` Bordeaux 1, France * Marc Feeley, Universite` de Montreal, Canada * Ron Garret, Amalgamated Widgets Unlimited, USA * Gregor Kiczales, University of British Columbia, Canada * Scott McKay, ITA Software, Inc., USA * Peter Norvig, Google Inc., USA * Julian Padget, University of Bath, UK * Kent Pitman, HyperMeta, USA * Christian Queinnec, Universite` Pierre et Marie Curie, France * Christophe Rhodes, Goldsmiths College, University of London, UK * Robert Strandh, Universite` Bordeaux 1, France * Mark Tarver, Lambda Associates, UK * Didier Verna, EPITA Research and Development Laboratory, France * JonL White, TheGingerIceCreamFactory of Palo Alto, USA * Taiichi Yuasa, Kyoto University, Japan Registration Fees: ****************** * Students EU100, regular EU220. Registration will include the proceedings, coffee breaks, the symposium dinner and other amenities. Accommodation is not included. From frgo at me.com Wed May 20 17:43:05 2009 From: frgo at me.com (Frank Goenninger) Date: Wed, 20 May 2009 19:43:05 +0200 Subject: [cells-devel] Cells: Why am I put in the debugger here ? Message-ID: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> Hi ! I have: (defmd color () red green blue alpha foreign-object :md-name (gensym "CELLO-COLOR-") :red (c-in 0) :green (c-in 0) :blue (c-in 0) :alpha (c-in 0) :foreign-object (c? (progn (when (and (^foreign-object) (not (null-pointer-p (^foreign- object)))) (foreign-free (^foreign-object))) (let ((fo (foreign-alloc :float :count 4))) (when (not (null-pointer-p fo)) (progn (setf (mem-aref fo :float 0) (/ (^red) 255.00000000000f0)) (setf (mem-aref fo :float 1) (/ (^green) 255.0000000000f0)) (setf (mem-aref fo :float 2) (/ (^blue) 255.0000000000f0)) (setf (mem-aref fo :float 3) (/ (^alpha) 255.0000000000f0)))))))) So far so good. Compiling this works ok. Now I do: CL-USER> (make-instance 'cnx::color :red 255 :green 128 :blue 0 :alpha 0) A NEW CELLS::C-DEPENDENT struct @ #x10c95502 = <...> 0 Class --------> # 1 MODEL --------> CELLO-COLOR-12992 2 SLOT-NAME ----> The symbol CNX::FOREIGN-OBJECT 3 VALUE --------> The symbol NIL 4 INPUTP -------> The symbol NIL 5 SYNAPTIC -----> The symbol NIL 6 CALLER-STORE -> (NIL), a proper list with 1 element 7 STATE --------> The symbol :AWAKE 8 VALUE-STATE --> The symbol :UNEVALUATED 9 PULSE --------> fixnum 0 [#x00000000] 10 PULSE-LAST-CHANGED -> fixnum 0 [#x00000000] 11 PULSE-OBSERVED -> fixnum 0 [#x00000000] 12 LAZY ---------> The symbol NIL 13 OPTIMIZE -----> The symbol T 14 DEBUG --------> The symbol NIL 15 MD-INFO ------> The symbol NIL 16 CODE ---------> ((PROGN ...)), a proper list with 1 element 17 RULE ---------> # 18 USEDS --------> The symbol NIL 19 USAGE --------> A simple-bit-vector (16) #*0000000000000000 [Current process: new-repl-thread] [1i] CL-USER(1): The only way out is a :reset - not good. What I am doing wrong ? (This is on AllegroCL 8.1). Thanks for any hints. Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2227 bytes Desc: not available URL: From pcn at pogt.dk Wed May 20 19:26:38 2009 From: pcn at pogt.dk (Peder Chr. =?iso-8859-1?q?N=F8rgaard?=) Date: Wed, 20 May 2009 21:26:38 +0200 Subject: [cells-devel] A thing that does not work well with Cells... Message-ID: <200905202126.38166.pcn@pogt.dk> Hi, fellow-cell'ers. I have this problem: I am attempting to port an existing bunch of software to Cells - to "cellulize" it. But there is one specific aspect - a "feature" that I am using - that does not work with Cells. I ask for advice. The "existing bunch" has made a habit of using classes with a number of ":allocation :class" slots. We occasionally have to access these slots without having access to an instance of the class; therefore we use the trick of accessing the slot-in-case of "sb-mop:class-prototype ". Now this has worked just fine until I start to cellulize the classes. Then it does not work at all. I have spent some time cooking down the problem. The attached file manifests the problem when you run it on an Sbcl system. To answer the most obvious question: no. No, I haven't tried it on CMUCL or any other LISP system capable of supporting Cells. And to the second-most obvious question, also no. No, I don't want to rewrite my current implementation to use some other technique to access class-specific information. My - shall we call it - hope is that someone with an in-deep knowledge of Cells can spot what aspect of SBCL class implementation that Cell fails to respect. I have spent a number of days digging into this, and I must admit failure. I simply cannot figure out why Cells make this otherwise fine working feature of SBCL fail. The failure happens someplace deep down in the PCL instance allocation, where all traces of Cells override ought to have disappeared... The problem seems to be, that when a class defined with DEFMODEL, subclass of MODEL, has a class-allocated slot, the initialization of the SB-PCL:PROTOTYPE slot triggered by the first use of SB-MOP:CLASS-PROTOTYPE - fails. Actually, it fails so thoroughly, that even the error report from the failure - eh - fails. When the access attempt is finished and the error break terminated, the SB-PCL:PROTOTYPE slot is not NIL, as it was after DEFMODEL and FINALIZE-INHERITANCE. It is unbound. However that happens - I haven't got the foggiest idea. The attached file contains a few failed attempts to work around the problem by digging deeper into the SBCL CLOS implementation. best regards --peder chr. -- Peder Chr. N?rgaard e-mail: pcn at pogt.dk Gefionsvej 19 DK-8230 ?byh?j tel: +45 87 44 11 99 Denmark mob: +45 30 91 84 31 -------------- next part -------------- A non-text attachment was scrubbed... Name: mofs.lisp Type: text/x-java Size: 1413 bytes Desc: not available URL: From ramarren at gmail.com Wed May 20 21:02:14 2009 From: ramarren at gmail.com (Ramarren) Date: Wed, 20 May 2009 23:02:14 +0200 Subject: [cells-devel] A thing that does not work well with Cells... In-Reply-To: <200905202126.38166.pcn@pogt.dk> References: <200905202126.38166.pcn@pogt.dk> Message-ID: Hello, I can hardly be considered to have an in depth knowledge of Cells, so I might be completely wrong, but the problem seems to be with the print-object for model class: from family.lisp: (defmethod print-object ((self model) s) #+shhh (format s "~a" (type-of self)) (format s "~a~a" (if (mdead self) "DEAD!" "") (or (md-name self) (type-of self)))) I have no idea why this would even be called when accessing class-allocated slots, but it is, and fails because slots needed to print the prototype object are unbound. This can be worked around by setting them, adding: (setf (slot-value (sb-mop:class-prototype (find-class 'my-model)) 'cells::.md-state) :prototype (slot-value (sb-mop:class-prototype (find-class 'my-model)) 'cells::.md-name) :prototype) To your file after finalize-inheritance makes the example work. I have no idea if this doesn't break something, I know about PCL even less than about Cells. Regards, Jakub Higersberger From ramarren at gmail.com Wed May 20 20:24:38 2009 From: ramarren at gmail.com (Ramarren) Date: Wed, 20 May 2009 22:24:38 +0200 Subject: [cells-devel] Cells: Why am I put in the debugger here ? In-Reply-To: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> References: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> Message-ID: Hello, On Wed, May 20, 2009 at 7:43 PM, Frank Goenninger wrote: > ?:foreign-object (c? (progn > ? ? ? ? ? ? ? ? ? ? ? ?(when (and (^foreign-object) I think the problem is here, you have a slot dependent on itself. To access slot previous value use .cache symbol macro, like this: (defmd color () red green blue alpha foreign-object :md-name (gensym "CELLO-COLOR-") :red (c-in 0) :green (c-in 0) :blue (c-in 0) :alpha (c-in 0) :foreign-object (c? (progn (when (and .cache (not (null-pointer-p .cache))) (foreign-free .cache)) (let ((fo (foreign-alloc :float :count 4))) (when (not (null-pointer-p fo)) (progn (setf (mem-aref fo :float 0) (/ (^red) 255.00000000000f0)) (setf (mem-aref fo :float 1) (/ (^green) 255.0000000000f0)) (setf (mem-aref fo :float 2) (/ (^blue) 255.0000000000f0)) (setf (mem-aref fo :float 3) (/ (^alpha) 255.0000000000f0)))))))) Regards, Jakub Higersberger From frgo at me.com Wed May 20 21:50:18 2009 From: frgo at me.com (Frank Goenninger) Date: Wed, 20 May 2009 23:50:18 +0200 Subject: [cells-devel] Cells: Why am I put in the debugger here ? In-Reply-To: References: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> Message-ID: Hello Jakub, Am 20.05.2009 um 22:24 schrieb Ramarren: > Hello, > > On Wed, May 20, 2009 at 7:43 PM, Frank Goenninger wrote: >> :foreign-object (c? (progn >> (when (and (^foreign-object) > > I think the problem is here, you have a slot dependent on itself. To > access slot previous value use .cache symbol macro, like this: > > (defmd color () > red > green > blue > alpha > foreign-object > > :md-name (gensym "CELLO-COLOR-") > :red (c-in 0) > :green (c-in 0) > :blue (c-in 0) > :alpha (c-in 0) > :foreign-object (c? (progn > (when (and .cache > (not (null-pointer-p .cache))) > (foreign-free .cache)) > (let ((fo (foreign-alloc :float :count 4))) > (when (not (null-pointer-p fo)) > (progn > (setf (mem-aref fo :float 0) > (/ (^red) 255.00000000000f0)) > (setf (mem-aref fo :float 1) > (/ (^green) 255.0000000000f0)) > (setf (mem-aref fo :float 2) > (/ (^blue) 255.0000000000f0)) > (setf (mem-aref fo :float 3) > (/ (^alpha) > 255.0000000000f0)))))))) > > Regards, > Jakub Higersberger Ouch, yes, of course. Thanks!!! Cheers Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2227 bytes Desc: not available URL: From pcn at pogt.dk Thu May 21 11:08:46 2009 From: pcn at pogt.dk (Peder Chr. =?iso-8859-1?q?N=F8rgaard?=) Date: Thu, 21 May 2009 13:08:46 +0200 Subject: [cells-devel] A thing that does not work well with Cells... In-Reply-To: References: <200905202126.38166.pcn@pogt.dk> Message-ID: <200905211308.46675.pcn@pogt.dk> Hello Jakub. Thanks for your answer. Well, there is no denying that your double setf makes the problem disappear in my small example. On the other hand, I would not dare to use a solution like this without knowing what the problem really is. And I still don't know that. Modifying the content of the prototype object of a class - which is what your proposal does - is too likely to have some devastating side effects - now .MD-STATE and .MD-NAME are no longer NIL by default, as specified in the definition of MODEL, they are :PROTOTYPE... And you are only partially right in that the problem is related to PRINT-OBJECT. I know that the error that I (and you, obviously) get looks like a problem with PRINT-OBJECT - but I think that this is because there is a deeper-lying problem that throws a condition - which then uses PRINT-OBJECT to write out something about the problem - and then that fails, too. Next step for me will to make an attempt to make PRINT-OBJECT more robust so I can get to the "real" condition. best regards --peder chr. On Wednesday 20 May 2009, you wrote: > Hello, > > I can hardly be considered to have an in depth knowledge of Cells, so > I might be completely wrong, but the problem seems to be with the > print-object for model class: > from family.lisp: > (defmethod print-object ((self model) s) > #+shhh (format s "~a" (type-of self)) > (format s "~a~a" (if (mdead self) "DEAD!" "") > (or (md-name self) (type-of self)))) > > I have no idea why this would even be called when accessing > class-allocated slots, but it is, and fails because slots needed to > print the prototype object are unbound. This can be worked around by > setting them, adding: > > (setf (slot-value (sb-mop:class-prototype (find-class 'my-model)) > 'cells::.md-state) :prototype > (slot-value (sb-mop:class-prototype (find-class 'my-model)) > 'cells::.md-name) :prototype) > > To your file after finalize-inheritance makes the example work. I have > no idea if this doesn't break something, I know about PCL even less > than about Cells. > > Regards, > Jakub Higersberger -- Peder Chr. N?rgaard e-mail: pcn at pogt.dk Gefionsvej 19 DK-8230 ?byh?j tel: +45 87 44 11 99 Denmark mob: +45 30 91 84 31 From kentilton at gmail.com Thu May 21 11:18:22 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Thu, 21 May 2009 07:18:22 -0400 Subject: [cells-devel] Cells: Why am I put in the debugger here ? In-Reply-To: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> References: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> Message-ID: <4A15387E.4@gmail.com> Frank Goenninger wrote: > Hi ! > > I have: > > (defmd color () > red > green > blue > alpha > foreign-object > > :md-name (gensym "CELLO-COLOR-") > :red (c-in 0) > :green (c-in 0) > :blue (c-in 0) > :alpha (c-in 0) > :foreign-object (c? (progn > (when (and (^foreign-object) use .cache to get the current value of the same cell a rule mediates. going through the normal slot accessor establishes a dependency of the cell on itself. Not good. Leads specifically to.... > (not (null-pointer-p > (^foreign-object)))) > (foreign-free (^foreign-object))) > (let ((fo (foreign-alloc :float :count 4))) > (when (not (null-pointer-p fo)) > (progn > (setf (mem-aref fo :float 0) > (/ (^red) 255.00000000000f0)) > (setf (mem-aref fo :float 1) > (/ (^green) 255.0000000000f0)) > (setf (mem-aref fo :float 2) > (/ (^blue) 255.0000000000f0)) > (setf (mem-aref fo :float 3) > (/ (^alpha) 255.0000000000f0)))))))) > > So far so good. Compiling this works ok. Now I do: > > CL-USER> (make-instance 'cnx::color :red 255 :green 128 :blue 0 :alpha 0) > > A NEW CELLS::C-DEPENDENT struct @ #x10c95502 = <...> > 0 Class --------> # > 1 MODEL --------> CELLO-COLOR-12992 > 2 SLOT-NAME ----> The symbol CNX::FOREIGN-OBJECT > 3 VALUE --------> The symbol NIL > 4 INPUTP -------> The symbol NIL > 5 SYNAPTIC -----> The symbol NIL > 6 CALLER-STORE -> (NIL), a proper list with 1 element > 7 STATE --------> The symbol :AWAKE > 8 VALUE-STATE --> The symbol :UNEVALUATED > 9 PULSE --------> fixnum 0 [#x00000000] > 10 PULSE-LAST-CHANGED -> fixnum 0 [#x00000000] > 11 PULSE-OBSERVED -> fixnum 0 [#x00000000] > 12 LAZY ---------> The symbol NIL > 13 OPTIMIZE -----> The symbol T > 14 DEBUG --------> The symbol NIL > 15 MD-INFO ------> The symbol NIL > 16 CODE ---------> ((PROGN ...)), a proper list with 1 element > 17 RULE ---------> # (MOP:CLASS-DEFAULT-INITARGS > CNX::COLOR > :FOREIGN-OBJECT) > 0) > @ #x10cb44ca> > 18 USEDS --------> The symbol NIL > 19 USAGE --------> A simple-bit-vector (16) #*0000000000000000 > [Current process: new-repl-thread] > [1i] CL-USER(1): > > The only way out is a :reset - not good. What I am doing wrong ? (This > is on AllegroCL 8.1). Actually, the above does not show a problem. "Only way out" of what? Possibly just printing the thing, since without *print-circle* set you will get into an infinite recursion when the cell lists its dependencies which include itself. hth, kt From kentilton at gmail.com Thu May 21 11:25:46 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Thu, 21 May 2009 07:25:46 -0400 Subject: [cells-devel] A thing that does not work well with Cells... In-Reply-To: <200905211308.46675.pcn@pogt.dk> References: <200905202126.38166.pcn@pogt.dk> <200905211308.46675.pcn@pogt.dk> Message-ID: <4A153A3A.2080504@gmail.com> Peder Chr. N?rgaard wrote: > Hello Jakub. > Thanks for your answer. Well, there is no denying that your double setf > makes the problem disappear in my small example. On the other hand, I would > not dare to use a solution like this without knowing what the problem really > is. And I still don't know that. > > Modifying the content of the prototype object of a class - which is what your > proposal does - is too likely to have some devastating side effects - > now .MD-STATE and .MD-NAME are no longer NIL by default, as specified in the > definition of MODEL, they are :PROTOTYPE... > > And you are only partially right in that the problem is related to > PRINT-OBJECT. I know that the error that I (and you, obviously) get looks > like a problem with PRINT-OBJECT - but I think that this is because there is > a deeper-lying problem that throws a condition - which then uses PRINT-OBJECT > to write out something about the problem - and then that fails, too. > > Next step for me will to make an attempt to make PRINT-OBJECT more robust so > I can get to the "real" condition. Good plan. Note that of course you could just lose the method if that is easier. This is just debugging code and it often bites me, too -- when stuck on a Cells issue I often end up tossing this and other print-objects. Nothing wrong tho with an effort to make it more robust so it can just stay in place. kt From frgo at me.com Thu May 21 13:03:21 2009 From: frgo at me.com (Frank Goenninger) Date: Thu, 21 May 2009 15:03:21 +0200 Subject: [cells-devel] Cells: Why am I put in the debugger here ? In-Reply-To: <4A15387E.4@gmail.com> References: <74F3F980-5DDB-440C-A254-33378D8446EF@me.com> <4A15387E.4@gmail.com> Message-ID: <34E18052-3EF3-46F7-9E37-3A40BA586EC9@me.com> Am 21.05.2009 um 13:18 schrieb Kenneth Tilton: > Frank Goenninger wrote: >> Hi ! >> I have: >> (defmd color () >> red >> green >> blue >> alpha >> foreign-object >> :md-name (gensym "CELLO-COLOR-") >> :red (c-in 0) >> :green (c-in 0) >> :blue (c-in 0) >> :alpha (c-in 0) >> :foreign-object (c? (progn >> (when (and (^foreign-object) > > use .cache to get the current value of the same cell a rule > mediates. going through the normal slot accessor establishes a > dependency of the cell on itself. Not good. Yes, of course - it was late and hot and I had not really thought about it. Sorry and thanks. > Leads specifically to.... > > >> (not (null-pointer-p (^foreign- >> object)))) >> (foreign-free (^foreign-object))) >> (let ((fo (foreign-alloc :float :count 4))) >> (when (not (null-pointer-p fo)) >> (progn >> (setf (mem-aref fo :float 0) >> (/ (^red) 255.00000000000f0)) >> (setf (mem-aref fo :float 1) >> (/ (^green) 255.0000000000f0)) >> (setf (mem-aref fo :float 2) >> (/ (^blue) 255.0000000000f0)) >> (setf (mem-aref fo :float 3) >> (/ (^alpha) >> 255.0000000000f0)))))))) >> So far so good. Compiling this works ok. Now I do: >> CL-USER> (make-instance 'cnx::color :red 255 :green 128 :blue >> 0 :alpha 0) >> A NEW CELLS::C-DEPENDENT struct @ #x10c95502 = <...> >> 0 Class --------> # >> 1 MODEL --------> CELLO-COLOR-12992 >> 2 SLOT-NAME ----> The symbol CNX::FOREIGN-OBJECT >> 3 VALUE --------> The symbol NIL >> 4 INPUTP -------> The symbol NIL >> 5 SYNAPTIC -----> The symbol NIL >> 6 CALLER-STORE -> (NIL), a proper list with 1 element >> 7 STATE --------> The symbol :AWAKE >> 8 VALUE-STATE --> The symbol :UNEVALUATED >> 9 PULSE --------> fixnum 0 [#x00000000] >> 10 PULSE-LAST-CHANGED -> fixnum 0 [#x00000000] >> 11 PULSE-OBSERVED -> fixnum 0 [#x00000000] >> 12 LAZY ---------> The symbol NIL >> 13 OPTIMIZE -----> The symbol T >> 14 DEBUG --------> The symbol NIL >> 15 MD-INFO ------> The symbol NIL >> 16 CODE ---------> ((PROGN ...)), a proper list with 1 element >> 17 RULE ---------> #> (MOP:CLASS-DEFAULT-INITARGS >> CNX::COLOR >> :FOREIGN-OBJECT) >> 0) >> @ #x10cb44ca> >> 18 USEDS --------> The symbol NIL >> 19 USAGE --------> A simple-bit-vector (16) #*0000000000000000 >> [Current process: new-repl-thread] >> [1i] CL-USER(1): >> The only way out is a :reset - not good. What I am doing wrong ? >> (This is on AllegroCL 8.1). > > Actually, the above does not show a problem. "Only way out" of what? Well, out of the inspector. When cells detects a circularity it calls (inspect ...) and I ended up in the AllegroCL inspector directly. > Possibly just printing the thing, since without *print-circle* set > you will get into an infinite recursion when the cell lists its > dependencies which include itself. I have set *print-circle* to t. So that was not the cause here. > > > hth, kt Yes, it did help ;-) Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2227 bytes Desc: not available URL: From pcn at pogt.dk Fri May 22 12:41:35 2009 From: pcn at pogt.dk (Peder Chr. =?iso-8859-1?q?N=F8rgaard?=) Date: Fri, 22 May 2009 14:41:35 +0200 Subject: [cells-devel] A thing that does not work well with Cells... SOLVED! well, kind of... In-Reply-To: References: <200905202126.38166.pcn@pogt.dk> <200905211308.46675.pcn@pogt.dk> Message-ID: <200905221441.35474.pcn@pogt.dk> Hello Jakub, Kenny Jakub beat me into making the PRINT-OBJECT method more robust. Nevertheless: my problem - whatever it is - has disappeared. I am not all that comfortable leaving behind me a problem (in SBCL or CELLS) that I don't understand. But at least this solution of Jakub's cannot possible have any negative side effects. I still don't have a clue what the basic problem is - I have spent a few hours today trying to get the modified PRINT-OBJECT method print something or enter the debugger - no such luck. I never see the output of the code snippet "(format s \"UNINITIALIZED-~a\" (type-of self)". It seems that when the method is recoded to be more robust, it stops being invoked. You confused? I am! At any rate, thanks for the support, I can now get on with my project. Kenny, you might wish to enter this small modification in the main Cells CVS source. Jakub, you write "Perhaps I do not understand your problem". I have been amiss explaining the manifestation of the problem. It comes here: with the origical Cells code, the first time I access - SETF or not - the PROTOTYPE slot af a newly defined PCL-CLASS - if the class in question is a model - the access fails. The access should trigger an allocation of the prototype object. The failure - whatever it is - is shadowed by the problem with PRINT-OBJECT. But the result is, that the PROTOTYPE slot in the PCL-CLASS object representing the MODEL class - is no longer NIL, it is unbound. But never mind, don't worry about this. Jakub's fix pushes this problem out of the real world, at least for me. best regards --peder chr. On Thursday 21 May 2009, you wrote: > Hello, > > On Thu, May 21, 2009 at 1:08 PM, Peder Chr. N?rgaard wrote: > > ? ? ? ?Modifying the content of the prototype object of a class - which > > is what your proposal does - is too likely to have some devastating side > > effects - now .MD-STATE and .MD-NAME are no longer NIL by default, as > > specified in the definition of MODEL, they are :PROTOTYPE... > > But in the prototype object they are not NIL anyway, but unbound, > which is the problem. As far as I can tell the prototype object is > used mostly for method computation. > > In any case changing relevant print-object method in family.lisp to [I > pushed it to my mostly cosmetic fork of cells at > http://github.com/Ramarren/cells/commit/b808dbd7cceea5573f09a1e02abbfb08e20 >478c7 ] > > (defmethod print-object ((self model) s) > #+shhh (format s "~a" (type-of self)) > (if (and (slot-boundp self '.md-state) > (slot-boundp self '.md-name)) > (format s "~a~a" (if (mdead self) "DEAD!" "") > (or (md-name self) (type-of self))) > (format s "UNINITIALIZED-~a" (type-of self)))) > > seems to work as well. Perhaps I do not understand your problem, what > I do is this (with the change above): > > CL-USER> (defmodel my-model (model) > ((my-class-slot :cell nil :ALLOCATION :CLASS))) > # > CL-USER> (sb-mop:finalize-inheritance (find-class 'my-model)) > NIL > CL-USER> (setf (slot-value (sb-mop:class-prototype (FIND-CLASS 'my-model)) > 'my-class-slot) 'a-value) > A-VALUE > CL-USER> (slot-value (sb-mop:class-prototype (find-class 'my-model)) > 'my-class-slot) > A-VALUE > > Regards, > Jakub Higersberger -- Peder Chr. N?rgaard e-mail: pcn at pogt.dk Gefionsvej 19 DK-8230 ?byh?j tel: +45 87 44 11 99 Denmark mob: +45 30 91 84 31 From frgo at me.com Sun May 24 14:19:26 2009 From: frgo at me.com (Frank Goenninger) Date: Sun, 24 May 2009 16:19:26 +0200 Subject: [cells-devel] Celtk: Double click not being sent to Cello Message-ID: Hi - I have: (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter *tcl-bindings* nil) (defun make-binding (tcl-event tcl-command-string) (let ((tcl-binding (conc$ "bind . " tcl-event " " tcl-command- string))) (pushnew tcl-binding *tcl-bindings*)))) (defun apply-bindings (&optional (bindings *tcl-bindings*)) (loop for binding in bindings do (format *debug-io* "Celtk: Applying binding ~S.~%" binding) (tk-format-now binding))) (defmacro defbinding (tcl-event tcl-command-string) `(eval-when (:compile-toplevel :load-toplevel :execute) (make-binding ,tcl-event ,tcl-command-string))) (defmacro define-binding-and-command (command tcl-event tcl-command- string) `(progn (defcommand ,command) (defbinding ,tcl-event ,tcl-command-string))) (define-binding-and-command double-click-1 "" "{do-double-click-1 %W %K; break}") (define-binding-and-command double-click-2 "" "{do-double-click-2 %W %K; break}") (define-binding-and-command double-click-3 "" "{do-double-click-3 %W %K; break}") and have extended #'run-window to call #'apply-bindings. Trace output shows that the bindings are actually executed as expected. I also extended class tk-object to have appropriate slots: (defmodel tk-object (model) ((.md-name :cell nil :initform (gentemp "TK") :initarg :id) (tk-class :cell nil :initform nil :initarg :tk-class :reader tk- class) (timers :owning t :initarg :timers :accessor timers :initform nil) (on-command :initarg :on-command :accessor on-command :initform nil) (on-key-down :initarg :on-key-down :accessor on-key-down :initform nil :documentation "Long story. Tcl C API weak for keypress events. This gets dispatched eventually thanks to DEFCOMMAND") (on-key-up :initarg :on-key-up :accessor on-key-up :initform nil) (on-double-click-1 :initarg :on-double-click-1 :accessor on-double- click-1 :initform nil) ;; <<< --- here (on-double-click-2 :initarg :on-double-click-2 :accessor on-double- click-2 :initform nil) ;; <<< --- and here (on-double-click-3 :initarg :on-double-click-3 :accessor on-double- click-3 :initform nil) ;; <<< --- and here (user-errors :initarg :user-errors :accessor user-errors :initform nil) (tile? :initform t :cell nil :reader tile? :initarg :tile?)) (:documentation "Root class for widgets and (canvas) items")) From the code I am reading that if any of the slots on-double- click-1 ... is assigned a function this function gets called as soon as a double-click-n is received... Yet Celtk always delivers a normal ButtonPress event ... Do I need to extend #'widget-event-handle of Celtk to make this work? Kenny, did this ever work for you? Any ideas ? Thx! Best, Frank -- Frank Goenninger Cell: +49 175 4321058 E-Mail: frgo at me.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2227 bytes Desc: not available URL: From alessiostalla at gmail.com Tue May 26 06:47:32 2009 From: alessiostalla at gmail.com (Alessio Stalla) Date: Tue, 26 May 2009 08:47:32 +0200 Subject: [cells-devel] Cells on ABCL Message-ID: <835c01920905252347h6e688f50ydd544837d5e38487@mail.gmail.com> Has anyone got Cells to work on ABCL? I've tried briefly (with Cells from CVS) and, with a couple minor modifications to it and to abcl, I got it to compile and load (despite the fact that CLOS & MOP are probably abcl's weakest point). Then I've tried to run the tests, but the last form in cv-test-person-3 makes it choke with: Debugger invoked on condition of type TYPE-ERROR: The value NIL is not of type STRUCTURE-OBJECT. Still, I've only spent a hour or so on this so far, and I'm pleased with the results. If anyone is interested, I'll keep you informed on my progress. Cheers, Alessio Stalla From kentilton at gmail.com Tue May 26 12:17:29 2009 From: kentilton at gmail.com (Kenneth Tilton) Date: Tue, 26 May 2009 08:17:29 -0400 Subject: [cells-devel] Cells on ABCL In-Reply-To: <835c01920905252347h6e688f50ydd544837d5e38487@mail.gmail.com> References: <835c01920905252347h6e688f50ydd544837d5e38487@mail.gmail.com> Message-ID: <4A1BDDD9.4020602@gmail.com> Alessio Stalla wrote: > Has anyone got Cells to work on ABCL? > > I've tried briefly (with Cells from CVS) and, with a couple minor > modifications to it and to abcl, I got it to compile and load (despite > the fact that CLOS & MOP are probably abcl's weakest point). Then I've > tried to run the tests, but the last form in cv-test-person-3 makes it > choke with: > > Debugger invoked on condition of type TYPE-ERROR: > The value NIL is not of type STRUCTURE-OBJECT. Does ABCL provide a backtrace that might show in which function the error originates? Also: IIRC, ct-assert says what it is doing as it goes. So how far are you getting? If I am wrong on that, just add some print statements so we can narrow it down. hth, kt From alessiostalla at gmail.com Tue May 26 20:55:24 2009 From: alessiostalla at gmail.com (Alessio Stalla) Date: Tue, 26 May 2009 22:55:24 +0200 Subject: [cells-devel] Fwd: Cells on ABCL In-Reply-To: <835c01920905261353r3a1d8da4u5cd5fc04cda67a6d@mail.gmail.com> References: <835c01920905252347h6e688f50ydd544837d5e38487@mail.gmail.com> <4A1BDDD9.4020602@gmail.com> <835c01920905261353r3a1d8da4u5cd5fc04cda67a6d@mail.gmail.com> Message-ID: <835c01920905261355lc14862wac73f12cdd922760@mail.gmail.com> Sorry, I sent this directly to Kenny instead of to the mailing list. Alessio ---------- Forwarded message ---------- From: Alessio Stalla Date: Tue, May 26, 2009 at 10:53 PM Subject: Re: [cells-devel] Cells on ABCL To: Kenneth Tilton On Tue, May 26, 2009 at 2:17 PM, Kenneth Tilton wrote: > Does ABCL provide a backtrace that might show in which function the error > originates? abcl's backtrace does not seem very useful: [1] CL-USER(8): :bt ?0: (BACKTRACE-AS-LIST) ?1: (INVOKE-DEBUGGER #) ?2: (CELLS::CV-TEST-PERSON-3) ?3: (CELLS::CV-TEST-PERSON) ?4: (FUNCALL CELLS::CV-TEST-PERSON) ?5: (SYSTEM::%TIME #) ?6: (CELLS::TEST-CELLS) ?7: (SYSTEM::%EVAL (CELLS::TEST-CELLS)) > Also: IIRC, ct-assert says what it is doing as it goes. So how far are you > getting? If I am wrong on that, just add some print statements so we can > narrow it down. This is what it prints before it fails: (CELLS::ATTEMPTING (EQL 1 (LENGTH (CELLS::CD-USEDS (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) 0> output thought # "speedy, slow down!"0> i am thinking "speedy, slow down!" (CELLS::ATTEMPTING (EQL 2 (LENGTH (CELLS::CD-USEDS (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) 0> output thought # "nice and easy does it"0> i am thinking "nice and easy does it" (CELLS::ATTEMPTING (EQL 1 (LENGTH (CELLS::CD-USEDS (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) Debugger invoked on condition of type TYPE-ERROR: ?The value NIL is not of type STRUCTURE-OBJECT. Probably it's an abcl bug (I've seen other times bugs that were apparent in the form of "NIL is not of type X"). In the next few days I'll be at the ELS, so I won't have much time to spend on the subject, but asap I'll try to debug it. Bye, Alessio From tburdick at gmail.com Wed May 27 06:49:02 2009 From: tburdick at gmail.com (Thomas F. Burdick) Date: Wed, 27 May 2009 08:49:02 +0200 Subject: [cells-devel] Fwd: Cells on ABCL In-Reply-To: <835c01920905261355lc14862wac73f12cdd922760@mail.gmail.com> References: <835c01920905252347h6e688f50ydd544837d5e38487@mail.gmail.com> <4A1BDDD9.4020602@gmail.com> <835c01920905261353r3a1d8da4u5cd5fc04cda67a6d@mail.gmail.com> <835c01920905261355lc14862wac73f12cdd922760@mail.gmail.com> Message-ID: <9A16B2F1-592D-40D2-8D19-F9803D539B85@gmail.com> Le 26 mai 09 ? 22:55, Alessio Stalla a ?crit : > Sorry, I sent this directly to Kenny instead of to the mailing list. > > Alessio > > ---------- Forwarded message ---------- > From: Alessio Stalla > Date: Tue, May 26, 2009 at 10:53 PM > Subject: Re: [cells-devel] Cells on ABCL > To: Kenneth Tilton > > > On Tue, May 26, 2009 at 2:17 PM, Kenneth Tilton > wrote: >> Does ABCL provide a backtrace that might show in which function the >> error >> originates? > > abcl's backtrace does not seem very useful: > > [1] CL-USER(8): :bt > 0: (BACKTRACE-AS-LIST) > 1: (INVOKE-DEBUGGER #) > 2: (CELLS::CV-TEST-PERSON-3) > 3: (CELLS::CV-TEST-PERSON) > 4: (FUNCALL CELLS::CV-TEST-PERSON) > 5: (SYSTEM::%TIME #) > 6: (CELLS::TEST-CELLS) > 7: (SYSTEM::%EVAL (CELLS::TEST-CELLS)) > >> Also: IIRC, ct-assert says what it is doing as it goes. So how far >> are you >> getting? If I am wrong on that, just add some print statements so >> we can >> narrow it down. > > This is what it prints before it fails: > > (CELLS::ATTEMPTING (EQL 1 (LENGTH (CELLS::CD-USEDS > (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) 0> output > thought # "speedy, slow down!"0> i am > thinking "speedy, slow down!" > (CELLS::ATTEMPTING (EQL 2 (LENGTH (CELLS::CD-USEDS > (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) 0> output > thought # "nice and easy does it"0> i am > thinking "nice and easy does it" > (CELLS::ATTEMPTING (EQL 1 (LENGTH (CELLS::CD-USEDS > (CELLS::MD-SLOT-CELL CELLS::P (QUOTE CELLS::THOUGHT)))))) > Debugger invoked on condition of type TYPE-ERROR: > The value NIL is not of type STRUCTURE-OBJECT. > > Probably it's an abcl bug (I've seen other times bugs that were > apparent in the form of "NIL is not of type X"). In the next few days > I'll be at the ELS, so I won't have much time to spend on the subject, > but asap I'll try to debug it. I'll be there too. If you have it on a laptop I could take a look at it while we're there. > Bye, > Alessio > > _______________________________________________ > cells-devel site list > cells-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cells-devel