递归写法:
(define (repeated f n) (if (= n 1) f (compose f (repeated f (- n 1)))))
迭代写法:
(define (repeateds f n) (define (iter i repeated-f) (if (= i 1) repeated-f (iter (- i 1) (compose f repeated-f)))) (iter n f))