Hatena::Grouphokudaisicp

TSBの日記

 | 

2008-12-01

1.3 --- 1-44 途中

| 17:56

(define (3heikin a b c) (/ (+ a b c) 3))

(define (inc x) (+ x 1))

(define (square x) (* x x))

(define (compose proc2 proc1) (lambda(x) (proc2 (proc1 x)) ) )

(define (repeated proc num) (

if(> num 0) (lambda(x) ( (repeated proc (- num 1)) (proc x) ) )

(lambda(x) x) ))

(define dx 0.000001)

(define (smooth f) (lambda(x) (3heikin (f (+ x dx)) (f x) (f (- x dx)) ) ))

(print ( (smooth square) 10))

(print ( (repeated (smooth square) 5) 10))

 |