[CM] scheme, s7
j_hearon at hotmail.com
Thu Apr 25 13:03:27 PDT 2013
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))))
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cmdist