[CM] sprouts & closure in CM

Anders Vinjar anders.vinjar@notam.uio.no
Sun, 12 Jun 2005 00:10:59 +0200


Just guessing here, but isnt this another situation where hooks
would be applicable?  The hooks could be set dynamically in
scheduled processes or anywhere else.

Something aka:

(setf *after-process-events-hook*
      (if (further-processes)
	  #'(lambda (head time start func)
	      (sprout (foo reps (next lev)) (now t)))
	nil))

Ive got no clues how to implement it for now though :-/ I guess
it involves a call inside #'schedule-event, and maybe redesigning
#'defprocess to return objects (with slots such as absolute time)
with easy access to :before or :after methods and whatnot.



>>> "t" == taube  <taube@uiuc.edu> writes:
t> 
t> You could chain processes using the 'finally' clause:
t> (define (foo reps lev)
t>   (process repeat reps
t>            output <whatever>
t>            wait <whenever>
t>            finally 
t>            (if (> lev 0) 
t>                (sprout (foo reps (- lev 1)) 
t>                        (now)))))
t> 
t> (events (foo 20 3) "foo.bar")
t> 
t> i should probably (re)implement a container like the old Thread class that would
t> process each subcontainer and generates all items before moving on to the next
t> subcontainer. the problem is that there is no 'rhythm slot for relative time
t> values and I havent quite figured out how to fold this into object-time
t> (absolute) time values. any ideas welcome!