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

begin0 splicing #375

Closed
jackfirth opened this issue Oct 19, 2024 · 0 comments · Fixed by #406
Closed

begin0 splicing #375

jackfirth opened this issue Oct 19, 2024 · 0 comments · Fixed by #406
Labels
new lint Issues suggesting new lints or pull requests implementing new lints

Comments

@jackfirth
Copy link
Owner

Resyntax ought to eliminate begin0 in the right-hand-side of define forms since those are always unnecessary. Saw this in benknoble/frosthaven-manager#106, where having this rule would have made another refactoring produce better output.

#lang resyntax/test

test: "begin0 in right hand side of define can be removed"
--------------------
#lang racket
(define (foo)
  (define x (begin0 42 (displayln "foo")))
  (* x 2))
--------------------
--------------------
#lang racket
(define (foo)
  (define x 42)
  (displayln "foo")
  (* x 2))
--------------------
@jackfirth jackfirth added the new lint Issues suggesting new lints or pull requests implementing new lints label Oct 19, 2024
jackfirth added a commit that referenced this issue Nov 20, 2024
jackfirth added a commit that referenced this issue Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new lint Issues suggesting new lints or pull requests implementing new lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant