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

Replace let forms with definitions in scribble/search #289

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Replace let forms with definitions in scribble/search #289

merged 1 commit into from
Jan 27, 2021

Conversation

jackfirth
Copy link
Sponsor Contributor

@jackfirth jackfirth commented Jan 25, 2021

This pull request was generated by an automated tool, with some by-hand postprocessing to preserve comments. The tool replaces uses of the various let forms with equivalent define forms, when doing so would reduce nesting and when it can prove that the binding structure remains unchanged. Parts of this change involved changing some code from using if to using cond, as well as other similar changes needed to introduce a definition context.

The tool produces moderately well-formatted code, but it makes a conscious effort to avoid changing the formatting of any existing subforms that were not refactored.

Note: the tool is called resyntax, and is implemented here.

@mflatt
Copy link
Member

mflatt commented Jan 25, 2021

This looks cool!

But it looks like there's a problem. I tried building with this patch, and I got need-result?: undefined; cannot use before initialization when raco setup tried to run the first document. I see that the revised code has (define need-result? (and need-result? (not here-result))), probably where the original code was intentionally shadowing need-result? with let.

@jackfirth
Copy link
Sponsor Contributor Author

Oops. There's a bit of logic to catch those cases with let, but not let*. I'll fix the tool and repush.

This commit was generated by an automated tool, with some by-hand postprocessing to preserve comments. The tool replaced uses of the various `let` forms with equivalent `define` forms, when doing so would reduce nesting and when it could prove that the binding structure remains unchanged. Parts of this change involved changing some code from using `if` to using `cond`, as well as other similar changes needed to introduce a definition context.

The tool produces moderately well-formatted code, but it makes a conscious effort to avoid changing the formatting of any existing subforms that were not refactored.
@jackfirth
Copy link
Sponsor Contributor Author

@mflatt I've fixed the bug in the tool that produced the buggy need-result? definition and repushed the generated changes.

@mflatt mflatt merged commit 5ee0f67 into racket:master Jan 27, 2021
@mflatt
Copy link
Member

mflatt commented Jan 27, 2021

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants