This preview shows page 1. Sign up to view the full content.
Unformatted text preview: exercise 1.43, page 77. But in fact this doesn’t work, because the “good enough” condition depends not on the current argument value, but on the number of times the function has been called. Write a function countiterativeimprove that’s like iterativeimprove except that each of its two argument functions takes two arguments: the current guess, and the number of times the improve function has been called so far. Here’s how it will be used: (define (repeated fn num) (countiterativeimprove (lambda (x cnt) (= cnt num)) (lambda x cnt) (fn x))))...
View
Full
Document
This note was uploaded on 08/26/2009 for the course CS 61A taught by Professor Harvey during the Spring '08 term at Berkeley.
 Spring '08
 Harvey

Click to edit the document details