首页 > 其他 > 详细

【SICP练习】113 练习3.33

时间:2015-03-26 14:59:51      阅读:257      评论:0      收藏:0      [点我收藏+]

练习3-33

原文

Exercise 3.33. Using primitive multiplier, adder, and constant constraints, define a procedure averager that takes three connectors a, b, and c as inputs and establishes the constraint that the value of c is the average of the values of a and b.

代码

(define (averager a b c)
    (let ((sum (make-connector))
          (d (make-connector)))
        (adder a b sum)
        (multiplier sum d c)
        (constant (/ 1 2) d)
        ‘ok))

【SICP练习】113 练习3.33

原文:http://blog.csdn.net/nomasp/article/details/44648325

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!