2009-04-14から1日間の記事一覧

今日の夕飯

牛焼肉(弁当の余り) キュウリ ポークジンジャー(豚もも肉) 挽き肉とジャガイモのカレー

SICP問題1.33

線形再帰な filtered-accumulate (define (filtered-accumulate combiner null-value term a next b filter) (cond ((> a b) null-value) ((filter a) (combiner (term a) (filtered-accumulate combiner null-value term (next a) next b filter))) (else (…

SICP問題1.32

線形再帰な accumulate (define (accumulate combiner null-value term a next b) (if (> a b) null-value (combiner (term a) (accumulate combiner null-value term (next a) next b)))) 反復手続きな accumulate (define (accumulate combiner null-value…

SICP問題1.31

線形再帰な product (define (product term a next b) (if (> a b) 1 (* (term a) (product term (next a) next b)))) 反復手続きな product (define (product term a next b) (define (iter a result) (if (> a b) result (iter (next a) (* (term a) resul…