University of Washington • CSE583 • D. Notkin © 2000
84
Comparing them
lFor many functions, the reduction order is immaterial to the computation
lfun sqr n = n * n;   // from D. Watt
lsqr (p+q) [say, p = 2, q = 5]
lFor applicative-order, we compute p+q=7, bind n to 7, then compute 49
lFor normal-order, we pass in “p+q” and evaluate 2+5 each time sqr uses n
lBut we get the same answer regardless