[cells-devel] Re: [cello-devel] Constructor syntax
Kenny Tilton
ktilton at nyc.rr.com
Wed May 12 15:12:20 UTC 2004
Thomas F. Burdick wrote:
> (defmodel adder ()
> ((x :accessor adder-x :initform (cv))
> (y :accessor adder-y :initform (cv))
> (sum :accessor adder-sum :initform (c? (+ (^adder-x) (^adder-y))))))
>
> (defparameter >>adder (to-be (make-instance 'adder)))
>
> (setf (adder-x >>adder) 0)
>
>The above happily works. It doesn't trigger the rule until I do:
>
> (adder-sum >>adder)
> => <unbound-cell error>
>
Add: (def-c-echo sum () (print (list self new-value old-value)))
...and you'll get the error when to-be runs.
I added your code. My c-install had evolved a little, so I just added
the make-unbound. I see you /had/ handle things on the read side, so I
am trying to remember what we had talked about on the propagation side:
>need to be made: cells doesn't currently catch the unbound-cell
>errors, because I wasn't sure where in the propagation code to put it.
>
The above is confusing. Cells (with your additions) certainly does catch
reads of unbound cells, as you noted once you accessed adder-sum.
kt
More information about the cells-devel
mailing list