Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automated Resyntax fixes #1431

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Automated Resyntax fixes #1431

wants to merge 20 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Jan 24, 2025

Resyntax fixed 50 issues in 18 files.

  • Fixed 9 occurrences of let-to-define
  • Fixed 8 occurrences of single-clause-match-to-match-define
  • Fixed 6 occurrences of define-syntax-syntax-rules-to-define-syntax-rule
  • Fixed 4 occurrences of quasiquote-to-list
  • Fixed 4 occurrences of if-else-false-to-and
  • Fixed 3 occurrences of sort-with-keyed-comparator-to-sort-by-key
  • Fixed 2 occurrences of zero-comparison-to-positive?
  • Fixed 2 occurrences of define-values-values-to-define
  • Fixed 1 occurrence of define-simple-macro-to-define-syntax-parse-rule
  • Fixed 1 occurrence of cond-let-to-cond-define
  • Fixed 1 occurrence of if-let-to-cond
  • Fixed 1 occurrence of provide-deduplication
  • Fixed 1 occurrence of when-expression-in-for-loop-to-when-keyword
  • Fixed 1 occurrence of for/fold-result-keyword
  • Fixed 1 occurrence of apply-append-for-loop-to-for-loop
  • Fixed 1 occurrence of always-throwing-if-to-when
  • Fixed 1 occurrence of inverted-when
  • Fixed 1 occurrence of map-to-for
  • Fixed 1 occurrence of apply-flattening
  • Fixed 1 occurrence of define-lambda-to-define

resyntax-ci bot added 20 commits January 24, 2025 00:28
The `define` form supports a shorthand for defining functions.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `define-syntax` macro can be replaced with a simpler, equivalent `define-syntax-rule` macro.
This `if` expression can be refactored to an equivalent expression using `and`.
This negated `when` expression can be replaced by an `unless` expression.
This expression is equivalent to calling the `positive?` predicate.
The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
Providing the same identifier multiple times is unnecessary.
`cond` with internal definitions is preferred over `if` with `let`, to reduce nesting
The `apply` function accepts single arguments in addition to a trailing list argument.
This `match` expression can be simplified using `match-define`.
This use of `define-values` is unnecessary.
This quasiquotation is equialent to a simple `list` call.
This `sort` expression can be replaced with a simpler, equivalent expression.
Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `map` operation can be replaced with a `for/list` loop.
Only one of the `for/fold` expression's result values is used. Use the `#:result` keyword to return just that result.
Instead of using `(apply append ...)` to flatten a list of lists, consider using `for*/list` to flatten the list.
Use the `#:when` keyword instead of `when` to reduce loop body indentation.
(locate-stx e))
e))))
(define l (current-logger))
(locate-stx e)
Copy link
Member

Choose a reason for hiding this comment

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

Losing this binding isn't wanted, although I see how it happened.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant