[CM] scheme, s7

James Hearon j_hearon at hotmail.com
Thu Apr 25 13:03:27 PDT 2013


Hi,
Having a devil of a time trying to figure out how to assign a variable and increment a counter in a loop or process.  Easy enough in c, but really struggling to do this in scheme.

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

Something like that would be what I'm after.  Tried using LET, also declaring LET or SET outside the process or a loop but still within the definition, and no joy there.
Any help for the parenthetically challenged greatly appreciated.
Regards,Jim Hearon 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20130425/b3b253f6/attachment.html 


More information about the Cmdist mailing list