18 hours ago
my attempt to do the exercises in sicp.
Sunday, March 14, 2010
sicp exercise 3.32
;; Exercise 3.32. The procedures to be run during each time segment of the agenda are kept in a queue. Thus, the procedures for each segment are called in the order in which they were added to the agenda (first in, first out). Explain why this order must be used. In particular, trace the behavior of an and-gate whose inputs change from 0,1 to 1,0 in the same segment and say how the behavior would differ if we stored a segment's procedures in an ordinary list, adding and removing procedures only at the front (last in, first out).
;; when set-signal! is called, it invokes the action procedures registered in the wire, which insert procedures to set the signal of another wire, but the value of the signal is computed at current time, not the time at whcih the output will be set. So it is important to maintain the order in which the input is changing so as to get the output to change in the same order.