On Sat, 01 Oct 2016 09:13:25 -0500, Angus wrote: > Then I changed smaller (and bigger) like this: > > (define (smaller w) > (interval (interval-small w) > (max (interval-small w) > (sub1 (guess w))))) > > to > > (define (smaller w) > (interval (interval-small w) > (max (interval-small w) > (sub1 (guess w))) ((+ interval-guesses 1) w))) > > > > But with these changes, when I run the program I get: > > +: contract violation > expected: number? > given: #<procedure:interval-guesses> > argument position: 1st > other arguments...: > 1
What is `interval-guesses`? Your code would like it to be a number, but it's actually an *accessor*. If you pass it an interval, then you'll get the number you want. Jumping ahead a little: you may also want to double-check how you're constructing your intervals. Vincent -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.