Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stepper problem with Schreibe Dein Programm & image teachpack #241

Open
jbclements opened this issue Feb 6, 2025 · 7 comments
Open

Stepper problem with Schreibe Dein Programm & image teachpack #241

jbclements opened this issue Feb 6, 2025 · 7 comments
Labels

Comments

@jbclements
Copy link
Contributor

It appears that when a teachpack is enabled in one of the Schreibe Dein Programm language levels, the stepper shows no steps, but insists that the program is instantly complete.

Steps to reproduce:

Start DrRacket
Set the language to SDP-Anfänger (using the language menu)
Choose Language > Add Teachpack...
Choose image.rkt from the list of preinstalled teachpacks
Open a new buffer
Enter this program

(define f (lambda (a x b) (* x a)))

(f 3 3 (f 9 10 11))

Click step.
See a stepper with only the text "All of the definitions have been successfully evaluated."

I'm absolutely over the moon to report that this bug appears to affect 8.15, as well, which means that I'm not inclined to block the release on it... I will add a note to the manual tests, to make sure it becomes part of standard testing.

@mikesperber
Copy link
Member

mikesperber commented Feb 6, 2025

This happens in lang/run-teaching-progam, which does this:

         (define body-exps (suck-all-exps port reader))           
         (define teachpack-requires (teachpacks->requires teachpacks))
         (rewrite-module
          (expand
           (datum->syntax
            #f
            `(,#'module ,module-name ,language-module 
              (#%module-begin ; avoid problems with macros in a 'module-begin context
               ,@body-exps
               ,@teachpack-requires
               ))
             (vector (object-name port) #f #f #f #f)))
          enable-testing?
          body-exps))]

Now, teachpack->requires sticks a stepper-skip-completely onto the
teachpack require form, as it should.

Once rewrite-module gets to the result of the call to expand, the
user-program form also has the same stepper-skip-completely annotation.
(I stuck a magic number onto the stepper-skip-completely property
instead of #t, so I know it's from there.) Any idea how? Case for
@mflatt ?

@shhyou shhyou added bug stepper teachpack [2]htdp teachpack labels Feb 6, 2025
@jbclements
Copy link
Contributor Author

Hmm.... are you saying that the stepper-skip-completely is on there before the stepper even gets hold of it?

@mikesperber
Copy link
Member

Hmm.... are you saying that the stepper-skip-completely is on there before the stepper even gets hold of it?

Exactly.

@jbclements
Copy link
Contributor Author

I'm probably telling you things you already know, but syntax properties are transferred from syntax supplied to transformers to their results, as described in file:///tmp/rkttmp/racket-8.15.900/doc/reference/stxprops.html#%28tech._stx._prop._preserved%29 . My next guess is that somehow ... there's a whole-module transformer for the SDP languages that winds up attaching this syntax property to all of the top-level forms?

@mikesperber
Copy link
Member

mikesperber commented Feb 9, 2025

I got desperate at a certain point and changed all instances of stepper-skip-completely to attach different magic numbers instead of #t. The one that's doing the damage is definitely the one from teachpack->requires. (Also, the #lang-based version of the SdP languages doesn't have this problem, and its uses the same top-level expander.)

@jbclements
Copy link
Contributor Author

Response to your first sentence: Right, yes, that's what I was thinking, along with a hypothetical later transformer step that transfers that mark to all top-level forms. Is that not plausible? Response to your second sentence: I'm wondering if the configuration of the syntax object could be subtly different in the case where the expressions are pulled one by one from the buffer, as opposed to the #lang version where the whole buffer is a single syntax expression? Sorry for not thinking more deeply about this, I'm definitely bouncing from thing to thing right now. For instance: butternut squash soup! Is it burning?

@mikesperber
Copy link
Member

No, I debug-printed out the properties right inside expand-teaching-program (before and after) - so I'm pretty sure expand is making the properties bleed over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants