[cells-devel] Cells: make-kid bypasses dependencies on kids of parent ?!

Ken Tilton kennytilton at optonline.net
Sat May 24 16:08:53 UTC 2008


Frank Goenninger wrote:
> I have the following definition:
> 
> ;; A task is a container for ops. A task holds its ops as kids. So,  when a
> ;;; task is called the task will call its kids.
> 
> (defmd task (family)
>   (.md-name :accessor id :initarg :id)
>   fn-code
>   thread
>   state
>   nr-ops
> 
>   :id (c-in (gensym "GNC.APP.TASK-"))
>   :fn-code (c-in nil)
>   :thread (c-in nil)
>   :state (c-in nil)
>   :nr-ops (c? (loop for kid in (^kids)
>                    counting (eql (type-of kid) 'op) into ops-count
>                    finally (return ops-count))))
> 
> Now, when I do
> 
>  > (setq self (make-instance 'task))
> TASK1
> 
>  > (setq my-kid (make-kid 'task))
> TASK 2
> 
>  > (^nr-ops)
> 0
> 
> ... and this should now be 1, no ? Or what's the right way to add kids ?

Add them? :) make-kid does not add to the kids of self.

(push (make-kid...) (kids self))

kt



More information about the cells-devel mailing list