[racket] htdp/2e: exercise 48, drracket highlighting

From: Daniel Bastos (dbastos at toledo.com)
Date: Mon Jan 19 07:55:51 EST 2015

Exercise 48. If you copy and paste the above function definition into the
definitions area of DrRacket and click RUN, DrRacket highlights two of the
three cond lines. This coloring tells you that your test cases do not cover
all possible cases. Add enough tests to make DrRacket happy. #

This exercise confused me for a long time. But now I understand it. The
words that threw me off were "do not cover all possible cases". I thought
it referred to the cases in the cond lines. I put an else there and still
saw lines being highlighted, including the expression in the else clause. I
was then sure I didn't understanding something. (By "test cases" I thought
they were the boolean expressions in the cond lines.)

Now I get it. DrRacket highlights the sections of code for which I didn't
write tests. That's a very nice feature. I think the book mentions this
feature for the first time in exercise 48.

On the web, someone had the same interpretation[1].

[1] Source:
http://stackoverflow.com/questions/12242573/trying-to-understand-why-drracket-highlights-some-of-my-cond-clauses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150119/c29b7595/attachment.html>

Posted on the users mailing list.