sicp-ex-4.53



<< Previous exercise (4.52) | Index | Next exercise (4.54) >>


meteorgan

  
  
 ((8 35) (3 110) (3 20)) 

the flow of how we got this result:

"prime-sum-pair"-->(3 20)
-->"permanent-set"-->pairs:((3 20))-->"(amb)", which means fail-->another try
-->"prime-sum-pair"-->(3 110)
-->"permanent-set"-->pairs:((3 110) (3 20))-->"(amb)", which means fail-->another try
-->"prime-sum-pair"-->(8 35)
-->"permanent-set"-->pairs:((8 35) (3 110) (3 20))-->"(amb)", which means fail-->another try
-->"prime-sum-pair"-->no more value, fail
-->"if-fail", the <fail> part-->return "pairs"

so, if we input "try-again", we will get
"There are no more values of (let ((pairs (quote))) (if-fail ..."