htdp
htdp copied to clipboard
Using stepper on template
Hi, I am a student taking BSL language at school and I would like to report a problem using stepper on a template.
It seems like ... in the template confusing the stepper which is supposed to be part of the infrastructure and I wonder if you can look into this problem
(eg,
(define (fn-for-function f) (cond [ (false? f) (....) ] ) [else (... f)] ))
Thank you!
I believe this issue should be transferred to the htdp
repository: https://github.com/racket/htdp
Seems like (quote-syntax ... #:local)
is not handled. I thought I saw this kind of issue fixed already, but that's clearly not the case.
Ah, it was #159, which fixes the problem for that program, but the issue persists for more complicated programs.
(...) ;; OK
(cond [#t (...)]
[else 1])
;; annotate-inner: nothing expands into begin! : (cons 'begin (cons (cons 'quote (cons 1 '())) '()))
(cond [#t (...)])
;; recon-source: no matching clause for syntax: (quote-syntax () #:local)
Regardless of fixes elsewhere, I think (quote-syntax ... #:local)
should be handled in places like https://github.com/racket/htdp/blob/master/htdp-lib/stepper/private/annotate.rkt#L843
Okay, yeah, I see the problem. I had tests with dots in parens, but only at the top level of lambdas where the inserted "begin" gets vacuumed away.
well, that's the issue with the first example, anyway....
Whoa... I've now spent about 10 hours debugging (okay actually probably 15 or 20) and I'm finding all kinds of interesting stuff. One or two serious bugs that have been lurking for a long long time. Yikes.
My guess is that the stepper is exercised in minimal ways, which is one possibility why these bugs have been around forever. Nobody besides me uses it beyond the first two weeks or so around here.
I think I'm going to take the next 10 students that come through my door looking for a senior project and tell them to fuzz-test the stepper.