about summary refs log blame commit diff stats
path: root/js/games/nluqo.github.io/~bh/61a-pages/Lectures/2.2/tree11.scm
blob: def3a033c79b8af565ac679fcc4f71eb66dabf50 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                              
(define (treemap fn tree)
  (make-tree (fn (datum tree))
	     (forest-map fn (children tree))))

(define (forest-map fn forest)
  (if (null? forest)
      '()
      (cons (treemap fn (car forest))
	    (forest-map fn (cdr forest)))))