(load "leaf.ss") ;; compare Program 7.25 (define filter-in-all-c (lambda (pred) (letrec ((helper ; TYPE: tree of a -> tree of a (lambda (ls) (if (null? ls) '() (let ((a (car ls))) (if (leaf? a) (if (pred a) (cons a (helper (cdr ls))) (helper (cdr ls))) (cons (helper a) (helper (cdr ls)))) ))))) helper)))