[cells-devel] removing an instance from a dependency

Ken McKee rkm1000 at bmrc.duhs.duke.edu
Mon Jun 19 20:50:18 UTC 2006


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)
    ))
#<STANDARD-CLASS SOME-MODEL>
APP(4): (defmodel another-model ()
   ((a-slot :cell t :accessor a-slot :initarg :a-slot)
    (name :cell nil :accessor name :initarg :name)
    ))
#<STANDARD-CLASS ANOTHER-MODEL>
APP(5): (setf foo (make-instance 'some-model))
#<SOME-MODEL @ #x10727422>
APP(6): (setf bar (make-instance 'another-model :name "bar1"
                          :a-slot (c? (print (name self))
                                    (a-slot foo))
                          ))
#<ANOTHER-MODEL @ #x107289a2>
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))
                          ))
#<ANOTHER-MODEL @ #x105e48b2>
APP(9): (a-slot bar)

"bar2"
NIL
APP(10): (setf (a-slot foo) 5)

"bar2"
"bar1"
5




More information about the cells-devel mailing list