[plt-scheme] horay(?) to me!

From: Mike (mikee at mikee.ath.cx)
Date: Sun Jun 11 20:43:07 EDT 2006

Ok, so many people here have been doing this a long time.
I'm starting to understand scheme, loops, and quasiquoting.
For no practical purpose at all I submit the following.


(let loop ((running #t))
  (let ((r (random 20)))
	(set! running (< r 17))
	(printf "r=~a running=~a~%" (number->string r) (if running "true" "false"))
	(printf "thread=~a~%"
			  `(lambda () (sleep (random 4)) (printf "thread count=~a~%" ,r)))))
	;(sleep 2)
	(if running
		;(sleep 2)
		(loop running)))))

Posted on the users mailing list.