Skip to content

Automated Resyntax fixes #1450

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
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Automated Resyntax fixes #1450

wants to merge 8 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented May 9, 2025

Resyntax fixed 50 issues in 18 files.

  • Fixed 35 occurrences of single-clause-match-to-match-define
  • Fixed 7 occurrences of let-to-define
  • Fixed 2 occurrences of define-let-to-double-define
  • Fixed 2 occurrences of inline-unnecessary-define
  • Fixed 1 occurrence of zero-comparison-to-negative?
  • Fixed 1 occurrence of map-to-for
  • Fixed 1 occurrence of cond-else-if-to-cond
  • Fixed 1 occurrence of if-else-false-to-and

resyntax-ci bot added 8 commits May 9, 2025 00:39
This `match` expression can be simplified using `match-define`.
This `map` operation can be replaced with a `for/list` loop.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This variable is returned immediately and can be inlined.
This `if` expression can be refactored to an equivalent expression using `and`.
The `else`-`if` branch of this `cond` expression can be collapsed into the `cond` expression.
This `let` expression can be pulled up into a `define` expression.
This expression is equivalent to calling the `negative?` predicate.
([dom (in-list dom*)]
#:when (pair? dom))
(cons (cdr dom) acc)))
(define check* (protect-loop rst dom+))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another for/reverse

[range-stx (if range #`(values #,@(map f range)) #'any)])
#'(arg-stx ... rest-stx ... . -> . range-stx))]))
(match-define (arr-combinator (arr-seq args rest range)) v)
(with-syntax ([(arg-stx ...) (map f args)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should resyntax use define/with-syntax?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've considered it. The opportunity doesn't seem to come up much though.

(map f* vals)
(and call-cc (map f* call-cc)))]))
(match-define (pt-seq vals call-cc) seq)
(define (f* a)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really want a way to turn this formatting decision off.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function in particular hardly seems worth defining at all.

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.

2 participants