[CM] scheme, s7

Bill Schottstaedt bil at ccrma.Stanford.EDU
Thu Apr 25 13:47:13 PDT 2013


I think in your example you need "sprout":

cm> (define counter 0)
counter
cm> (define (bump-counter) (process repeat 5 do (set! counter (+ counter 1))))
bump-counter
cm> (sprout (bump-counter))

cm> counter
5


In straight scheme there are several ways to do this:

(do ((i 0 (+ i 1))) ((= i 5)) (set! counter (+ counter 1)))

for example.




More information about the Cmdist mailing list