Skip to content

Instantly share code, notes, and snippets.

@yao2030
Created December 11, 2012 08:16
Show Gist options
  • Save yao2030/4256823 to your computer and use it in GitHub Desktop.
Save yao2030/4256823 to your computer and use it in GitHub Desktop.
(define (tree-map proc tree)
(cond ((null? tree) '())
((not (pair? tree)) (proc tree))
(else (cons (tree-map proc (car tree))
(tree-map proc (cdr tree))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment