[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question on HtDP Exercise



This is from exercise 5.1.2 in HtDP.  Instructions say to load the
guess.ss teachpack, compose function 'check-guess', test
check-guess, and then evaluate the expression:

	(repl check-guess)

I composed the following function:

;;Exercise-5.1.2
;;
;;check-guess: number number -> symbol
;;determines whether a players guess as to the
;;value of an unknown number is too low, too
;;high or perfect
(define (check-guess guess target)
  (cond
    [(< guess target) 'TooSmall]
    [(> guess target) 'TooLarge]
    [else 'Perfect]))

I checked it out, and it performs accurately, but when I execute the
        (repl check-guess)
expression by entering it in either the top or bottom window of DrScheme,
I get the following error:

	reference to undefined identifier: repl

I was assuming that this must be in guess.ss, the teachpack, but I guess it
isn't.  Can someone help me?  I also tried loading the guess-gui.ss teachpack
as well, but the error stayed.  Thanks.  JeffS