htdp icon indicating copy to clipboard operation
htdp copied to clipboard

stepper fails for unbound id in test position of check-expect

Open jbclements opened this issue 4 years ago • 26 comments

To reproduce:

  1. Set language level to Beginner
  2. put this program in defns window:

(check-expect (f (list 4)) (list 4 13)) (check-expect (f (list 4)) (list 7 13))

Click Step.

See this error:

recon-source: no matching clause for syntax: (quote-syntax f)

Looks like in this case the reconstructed source contains a quote-syntax.

This bug has been present since at least Racket 7.4.

jbclements avatar Jul 15 '21 09:07 jbclements

The test engine recently fixed the source location of syntax errors in check-expects (#152). Is it related or is the bug exposed by that?

shhyou avatar Jul 19 '21 02:07 shhyou

perhaps indirectly. I think the issue here is that the reconstructor is just blindsided by the appearance of a quote-syntax, which suggests that it has to do with the expansion of the test forms. Could be related, though. Programming is complicated....

jbclements avatar Jul 19 '21 14:07 jbclements

perhaps indirectly. I think the issue here is that the reconstructor is just blindsided by the appearance of a quote-syntax, which suggests that it has to do with the expansion of the test forms.

The expansion of tests forms certainly did change, but there's no (obvious) quote-syntax sitting there. (And the macros stepper refuses to work in the presence of undefined variables, AFAICS.)

The relevant macro is here, if that helps:

https://github.com/racket/htdp/blob/fc6c2c264179b14fa6cb9ecb1ccdfd69df03a757/htdp-lib/test-engine/syntax.rkt#L29

mikesperber avatar Jul 25 '21 12:07 mikesperber