<div dir="ltr"><div>I am not sure whether this is a the right list to post this question. Else please let me know.<br><br></div>I run this in Dr. racket.<br><div><br>#lang racket<br>(define lower 1)<br>(define upper 100)<br>
<br>(define (guess)<br> (quotient (+ lower upper) 2))<br><br>(define (smaller)<br> (set! upper (max lower (guess (sub1 guess))))<br> (guess))<br><br></div><div>When i invoke the smaller function in the repl i get:<br><br>
Welcome to DrRacket, version 5.3.5--2013-06-18(-/f) [3m].<br>Language: racket; memory limit: 128 MB.<br>> (smaller)<br>. . sub1: contract violation<br> expected: number?<br> given: #<procedure:guess><br>> <br>
<br></div><div>What am i doing wrong?<br><br></div><div>- Jo<br></div></div>