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: steps appear as if capturing happens #1714

Open
martin-henz opened this issue Sep 3, 2024 · 0 comments
Open

Stepper: steps appear as if capturing happens #1714

martin-henz opened this issue Sep 3, 2024 · 0 comments
Labels
Bug Something isn't working good project

Comments

@martin-henz
Copy link
Member

martin-henz commented Sep 3, 2024

The stepper doesn't distinguish variables properly when they are already referring to functions:

https://share.sourceacademy.org/svqdz

function h(f, x) {
    function h(g, x) {
        return x <= 1 ? 1 : 3 * g(f, x - 1);
    }
    return x <= 1 ? 1 : 2 * f(h, x - 1);
}
h(h, 5);

Here, the two h in h(h(5 - 1)) refer to different values:
Screenshot 2024-09-03 at 4 32 03 PM
The fact that they are different becomes clear here:
Screenshot 2024-09-03 at 4 32 17 PM
Note that only one of the h are highlighted as being substituted.

The stepper should make clear that the two h are different by appropriately renaming one of them.

(This is called alpha-renaming, and already done properly for other cases.)

@martin-henz martin-henz added Bug Something isn't working good project labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working good project
Projects
None yet
Development

No branches or pull requests

1 participant