Open jasonhemann opened 1 week ago
I'm not sure what's the best fix for this either, but one possibility might be an error saying that the box around the image snip is not a legal program in BSL. If that sounds right, then I think that that'd be a change in the bsl repo somewhere.
I get
Welcome to DrRacket, version 8.13.0.9 [cs]. Language: htdp/bsl, with debugging [custom]. The test passed!
for
#lang htdp/bsl
(require 2htdp/image)
(check-expect (circle 10 'outline 'black) .)
when I copy over the black circle.
Why would a student copy-and-paste the square when he expects to see a black circle?
Why would a student copy-and-paste the square when he expects to see a black circle?
Perhaps the student might not know that it is possible to copy only just the circle, and thought that the frame is just for decoration. I could see myself easily make this mistake.
So
(if (image? x) x (frame (render x)))
?
FWIW, I agree with Sorawee that what Jason describes is a totally reasonable (although wrong) thing to do and it would be good if something better happened in response to it. That said, I don't get what Matthias is trying to say with the if
expression.
I don't quite understand the suggested fix yet either.
My guess is that Matthias was suggesting a workaround to make the framing snip comparable as an image?
That's exactly what my if
expression was supposed to suggest. [[ Sorry I was on the road for the week. ]]
The following error-scenario seems unnecessarily unfriendly, and I'm wondering if something nicer is possible.
A student might write the following test program:
This test will fail. The student receives an error message containing a snip that contains the expected value. Our student then---mistakenly, accidentally, or what have you---then picks up the whole snip and drops that in as a replacement
expect
value.Now that student sees the even more confusing:
This seems especially injurious because it shows up when a student is already grappling with code that isn't behaving the way he expects. I for one do not know how to explain this behavior in a way that makes good sense to a BSL student. Is something nicer is possible?
I do not know if this properly belongs here, or in the
htdp
repo, or elsewhere.