On Saturday, 1 October 2016 15:30:19 UTC+1, Vincent St-Amour wrote: > 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
I don't understand. How would I pass it an interval? I am confused about the w parameter in smaller. ie (define (smaller w) what is w? Is that the current interval held as state within big-bang? So in that case do I write it like this: (interval-guesses (+ w 1)) ??? -- 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.