SICP Exercise 3.28

来源:互联网 发布:黑桐谷歌淘宝 编辑:程序博客网 时间:2024/05/17 08:47

SICP Exercise 3.28

This exercise is easy.

;Exercise 3.28(define (or-gate in1 in2 out)  (define (and-action-procedure)    (let ((new-value (logic-or (get-signal in1)                               (get-signal in2))))      (after-delay or-gate-delay                   (lambda ()                     (set-signal! out new-value)))))  (add-action! in1 and-action-procedure)  (add-action! in2 and-action-procedure)  'ok)


原创粉丝点击