racket / htdp

Other
91 stars 69 forks source link

incorrect error, got "this variable is not defined" but expected "divison by zero" #205

Closed rfindler closed 10 months ago

rfindler commented 11 months ago

It looks like 61660bdc9a0920d7d62dbd7aaede4ddb381ad27d introduced a bug whereby this program:

(define y 0)
(define (f x) (/ x y))
(f 2)

in all five of the language-dialog based teaching languages produces the wrong error.

Here's the drdr report. You can run the currently failing test with racket -l tests/drracket/language-test.

[ edit: corrected the commit, f497f10dd848b6f4fc97e20713af2d8608f352b3 is the wrong one; that one was fine in drdr. The commit 61660bdc9a0920d7d62dbd7aaede4ddb381ad27d is the one where the trouble started. And deinprogramm is very unlikely to be related. ]

samth commented 11 months ago

https://github.com/racket/htdp/commit/f497f10dd848b6f4fc97e20713af2d8608f352b3 is a test case that you added; is that the commit you meant?

rfindler commented 11 months ago

Whoops, thanks @samth . I've corrected the message.

@mikesperber do you mind having a look?

rfindler commented 11 months ago

@mikesperber also, if you have a test case for the change in 61660bdc9a0920d7d62dbd7aaede4ddb381ad27d I can try to add it to the test suite.

mikesperber commented 11 months ago

You can reproduce the problem by typing y in the REPL after running this program.

rfindler commented 11 months ago

Thanks, @mikesperber ! I've made a new attempt at this change in #207 . Your opinion on it would be welcome.

jbclements commented 10 months ago

I have a bad habit of getting things like this wrong, but the discussion in #207 suggests that this bug is now resolved. Feel free to re-open it if I'm wrong!