现在的位置: 首页 > 综合 > 正文

SICP Exercise 3.28

2013年09月18日 ⁄ 综合 ⁄ 共 298字 ⁄ 字号 评论关闭

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)

抱歉!评论已关闭.