Sunday, June 7, 2009

Ex-2.31

(define (tree-map proc tree)
(map
(lambda (x)
(if (pair? x)
(tree-map proc x) (proc x))) tree))
(define (square-tree tree)
(tree-map square tree))

No comments:

Post a Comment