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 #1432

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

Automated Resyntax fixes #1432

wants to merge 19 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

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

Resyntax fixed 50 issues in 16 files.

  • Fixed 11 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 3 occurrences of quasiquote-to-list
  • Fixed 3 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 if-let-to-cond
  • Fixed 2 occurrences of always-throwing-if-to-when
  • Fixed 1 occurrence of define-simple-macro-to-define-syntax-parse-rule
  • Fixed 1 occurrence of when-expression-in-for-loop-to-when-keyword
  • Fixed 1 occurrence of for/fold-result-keyword
  • Fixed 1 occurrence of define-let-to-double-define
  • Fixed 1 occurrence of apply-append-for-loop-to-for-loop
  • Fixed 1 occurrence of inverted-when
  • Fixed 1 occurrence of apply-flattening
  • Fixed 1 occurrence of inline-unnecessary-define
  • Fixed 1 occurrence of define-lambda-to-define
  • Fixed 1 occurrence of define-values-values-to-define

resyntax-ci bot added 19 commits January 31, 2025 00:27
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.
This `sort` expression can be replaced with a simpler, equivalent expression.
This `match` expression can be simplified using `match-define`.
The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
The `define` form supports a shorthand for defining functions.
`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 variable is returned immediately and can be inlined.
This `let` expression can be pulled up into a `define` expression.
This quasiquotation is equialent to a simple `list` call.
This use of `define-values` is unnecessary.
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.
# 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.

0 participants