sicp-ex-4.27



<< Previous exercise (4.26) | Index | Next exercise (4.28) >>


meteorgan

  
  
  
 (define w (id (id 10))) 
  
 ;;; L-Eval input: 
 count 
 ;;; L-Eval value: 
 1  
 because when define w, call (id (id 10)), parameter (id 10) is delayed. so id only call once. count = 1. 
  
 ;;; L-Eval input: 
 w 
 ;;; L-Eval value: 
 10 
 when enter w in prompt, call (actual-value w), (id 10) is evaluated, id is called once more. so now w = 10, count = 2. 
 ;;; L-Eval input: 
 count 
 ;;;; L-Eval value: 
 2