2013年3月8日

摘要: (define producti (lambda (f a next b) (define iter (lambda (a result) (if (> a b) result (iter (next a) (* result (f a)))))) (iter a 1)))(define product (lambda (f a next b) (if (> a b) 1 (* (f a) (product f (next a) next b)))))(define facto... 阅读全文

posted @ 2013-03-08 17:26 ASOCS 阅读(184) 评论(0) 推荐(0)

摘要: (define sumi (lambda (term a next b) (define iter (lambda (a result) (if (> a b) result (iter (next a) (+ result (term a)))))) (iter a 0)))chez和ikarus的表现完全不一样..chez:> (time (sum (lambda (x) (* 2 x)) 0 (lambda (x) (+ x 1)) 3800011))(time (sum (lambda (...) ...... 阅读全文

posted @ 2013-03-08 16:28 ASOCS 阅读(113) 评论(0) 推荐(0)

摘要: (define s-rule (lambda (f a b n) (let [(h (/ (- b a) (* n 1.0))) (k 0)] (* (/ h 3) (sum (lambda (x) (let ([k (cond [(= x 0) 1] [(= x n) 1] [(odd? x) 4] [else ... 阅读全文

posted @ 2013-03-08 15:43 ASOCS 阅读(100) 评论(0) 推荐(0)