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

Popular posts from this blog

SICP Exercise 4.18 a alternative strategy for interpreting internal definitions

SICP Exercise 3.11 make-account internal definitions with local state

SICP Exercise 3.13 make-cycle