SICP Exercise 3.28 or-gate

Exercise 3.28.  Define an or-gate as a primitive function box. Your or-gate constructor should be similar to and-gate.

SOLUTION

The code is here.

Note: I enhanced the or-action-procedure (from the and-action-procedure in the textbook) to call set! on the output wire only if the set! will change the signal on the wire. 

Comments