#lang planet neil/sicp
(define lst (list 57 321 88))
(define thing (lambda (x) (newline) (display x)))
(define (for-each thing lst)
(cond ((not (null? lst))
(thing (car lst))
(for-each thing (cdr lst)))))
运行结果:
Welcome to DrRacket, version 5.3.3 [3m].
Language: planet neil/sicp; memory limit: 512 MB.
> (for-each thing lst)
57
321
88
>