jackfirth / jackfirth/resyntax

Suggest using the `#:with` pattern directive instead of `with-syntax`

Open
#143 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new lint
Dominant language
Racket
Stars
70
Forks
11
PR merge metrics
No merged PRs in 30d

Description

In uses of syntax-parse, clauses whose tail expression is a with-syntax form can be replaced with #:with pattern directives. For example, given this expression:

(syntax-parse stx
  [foo:id
   (with-syntax ([bar #'(+ 1 2 3)])
     #'(foo bar)])

Resyntax ought to suggest simplifying it to this:

(syntax-parse stx
  [foo:id
   #:with bar #'(+ 1 2 3)
   #'(foo bar)])

This can open up the door for related simplifications of syntax-parse such as #142.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Resyntax's handling of syntax-parse clauses and any existing tests for related refactorings. Compare the with-syntax example with the requested #:with pattern directive, and review issue #142 for related simplifications. Done means the transformation is suggested correctly without changing the resulting syntax.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.