resyntax
resyntax copied to clipboard
Replace `syntax->list` with `attribute`
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)])
--------------------