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
_______________________________________________
cells-devel site list
cells-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/cells-devel