[CM] sprouts & closure in CM

Drew Krause drkrause@mindspring.com
Fri, 10 Jun 2005 14:58:36 -0400

I'd like to do something fairly simple in CM: define a function that 
would place sections end-to-end, starting one section when the previous 
section ends. I can do this by setting a global variable:

(setf glob-ending '())

Then defining the 'collecting' program ...

(define sections (&rest sprts)
    (process (for sprt in sprts
    sprout (eval sprt)
    wait glob-ending)))

... and adding the following line to each 'sprouted' section I'm using, 
so it's passed back to "sections":

finally (setf glob-ending (now))

This is not the most desirable method for obvious reasons -- 
specifically, I'd like this section-length variable to be closed inside 
"sections". Any solutions/other approaches out there? Thanks!