[CM] Wait times for sprouted functions - CM/Lisp Question.

Landspeedrecord landspeedrecord@gmail.com
Thu, 21 Jun 2007 18:40:42 -0400


Hi,

Is there a way for a sprouted function to pass its total duration back
to a parent function so that the parent function can use that value as
the wait time before calling the next sprout command?

Basically I want to sprout a function multiple times so that the start
of each succesive iteration of the function lines up with the end of
the one before it.  The problem is that the total length of each
function is determined by the parameters passed to the function so the
"parent" function that is making the call to sprout doesn't know how
long to wait.

Any Ideas?  Below is rough idea of what I am talking about:

 (define (ParentFunction x y z)
  (process for i from x to y by z
           sprout (SproutedFunction i)
           wait ?????))

I could rewrite ParentFunction to include all the code from
SproutedFunction but that seems silly... not to mention very bad
functional programming.  There must be a way to pass the duration info
back from SproutedFunction.