Looping: DO
> (define (promise n)
; Prints a promise N times.
(let ((the-promise
"I will balance parentheses"))
(do ((i 0 (+ i 1)))
((= i n))
(display i)
(display ". ")
(display the-promise)
(newline)
) ) )
> (promise 3)
0. I will balance parentheses.
1. I will balance parentheses.
2. I will balance parentheses.
Previous slide
Next slide
Back to first slide
View graphic version