[CM] Sprouting processes from sequences?

Larry Troxler lt@westnet.com
Sat, 25 Jan 2003 17:10:18 -0500


Rick Taube wrote:
> 
> actually, as i look at it i realize you should not use enqueue - just call schedule-object recursivly instead. that way the stuff you are adding will get initialized correctly no matter what it is.
> 
> (defmethod schedule-object ((obj arpeggio) start)
>   (let ((add (create-arpeggio-objects obj)))
>      ;; add stuff to queue but not self.
>      (dolist (a add)
>        (schedule-object a start ))))
> 

Actually, as you suggested in another message, I defined write-event
instead of schedule-object, on my "aggregate" event.
This is the only thing that worked, because the schedule-object method
on seq's uses enqueue and never calls schedule-object except for
containers - this is how it is defined in CM:

(defmethod schedule-object ((obj seq) start)
  (let ((mystart (+ start (object-time obj))))
    (enqueue (subobjects obj) mystart mystart)
    (dolist (sub (subcontainers obj)) (schedule-object sub mystart))))

Larry Troxler