Skip to content

Replace syntax->list with attribute #372

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

Open
jackfirth opened this issue Oct 16, 2024 · 0 comments
Open

Replace syntax->list with attribute #372

jackfirth opened this issue Oct 16, 2024 · 0 comments
Labels
new lint Issues suggesting new lints or pull requests implementing new lints

Comments

@jackfirth
Copy link
Owner

jackfirth commented Oct 16, 2024

When using syntax-parse, ellipses-bound pattern variables are often converted to lists using (syntax->list #'(var ...)) but they can be extracted as lists directly using (attribute var). There should be a rule for this.

#lang resyntax/test

test: "syntax->list with #'(var ...) refactorable to (attribute var)"
--------------------
#lang racket
(syntax-parse #'(a b c)
  [(id ...) (syntax->list #'(id ...))])
--------------------
--------------------
#lang racket
(syntax-parse #'(a b c)
  [(id ...) (attribute id)])
--------------------
@jackfirth jackfirth added the new lint Issues suggesting new lints or pull requests implementing new lints label Oct 16, 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

No branches or pull requests

1 participant