Looping: DO (2nd example)
> (define (print-on-separate-lines lst)
; Prints LST with one line per element.
(do ((tmp lst (cdr tmp)))
((null? tmp))
(let ((elt (car tmp)))
(display elt)
(newline) ) ) )
> (print-on-separate-lines
'(lunch around the corner) )
LUNCH
AROUND
THE
CORNER
Previous slide
Next slide
Back to first slide
View graphic version