University of Washington CSE583 D. Notkin
©
2000
62
Continuation example
l
(define (find pred x if-found if-not-found)
l
(cond ((null? x) (if-not-found))
l
((pred (car x)) (if-found (car x)))
l
(else (find pred (cdr x)
l
if-found if-not-found
l
)))))
l
(find is-positive? (2 5 0)
l
(lambda (y) Yes) (lambda () No))