3 [clojure.contrib trace test-is]))
5 ;; exercise 1.5: Ben Bitdiddle has invented a test to determine
6 ;; whether the interpreter he is faced with is
7 ;; using applicative-order evaluation or normal-order
8 ;; evaluation. He defines the following two procedures:
15 ;; Then he evaluates the expression
19 ;; What behavior will Ben observe with an interpreter that uses
20 ;; applicative-order evaluation?
22 In the case of applicative order evaluation, the test gets into
23 and infinite loop (eventually using all the stack), as the parameters
24 are evaluated before they are actualy used in the function.
26 ;; What behavior will he observe with an interpreter that uses
27 ;; normal-order evaluation? Explain your answer.
29 It will print 0, as (p) is not evaluated in this case.