(define traverse (lambda (combine do seed) 
                   (lambda (x) 
                     (cond ((eq? x '()) seed)
                           (#t (combine (do (car x)) 
                                         ((traverse combine do seed) (cdr x))))))))
(define mapsquare (traverse cons (lambda (x) (* x x)) '()))
(mapsquare '(1 -2 3))

CSCi 4651 home page

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.