Skip to content
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

Automated Resyntax fixes #1433

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

Automated Resyntax fixes #1433

wants to merge 21 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Feb 7, 2025

Resyntax fixed 50 issues in 20 files.

  • Fixed 12 occurrences of let-to-define
  • Fixed 11 occurrences of single-clause-match-to-match-define
  • Fixed 4 occurrences of cond-let-to-cond-define
  • Fixed 3 occurrences of define-lambda-to-define
  • Fixed 3 occurrences of if-else-false-to-and
  • Fixed 2 occurrences of nested-if-to-cond
  • Fixed 2 occurrences of map-to-for
  • Fixed 2 occurrences of cond-else-if-to-cond
  • Fixed 1 occurrence of quasiquote-to-list
  • Fixed 1 occurrence of define-simple-macro-to-define-syntax-parse-rule
  • Fixed 1 occurrence of define-values-values-to-define
  • Fixed 1 occurrence of append*-and-map-to-append-map
  • Fixed 1 occurrence of provide-deduplication
  • Fixed 1 occurrence of for/fold-result-keyword
  • Fixed 1 occurrence of define-let-to-double-define
  • Fixed 1 occurrence of equal-null-list-to-null-predicate
  • Fixed 1 occurrence of always-throwing-if-to-when
  • Fixed 1 occurrence of inverted-when
  • Fixed 1 occurrence of syntax-disarm-migration

resyntax-ci bot added 21 commits February 7, 2025 00:31
The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`.
The `null?` predicate can be used to test for the empty list.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `map` operation can be replaced with a `for/list` loop.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This negated `when` expression can be replaced by an `unless` expression.
This `if` expression can be refactored to an equivalent expression using `and`.
Providing the same identifier multiple times is unnecessary.
The `syntax-disarm` function is a legacy function that does nothing.
This `match` expression can be simplified using `match-define`.
The `define` form supports a shorthand for defining functions.
Only one of the `for/fold` expression's result values is used. Use the `#:result` keyword to return just that result.
The `append-map` function can be used to map each element into multiple elements in a single pass.
The `else`-`if` branch of this `cond` expression can be collapsed into the `cond` expression.
This use of `define-values` is unnecessary.
Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
This quasiquotation is equialent to a simple `list` call.
This `if` expression can be refactored to an equivalent expression using `and`.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `if`-`else` chain can be converted to a `cond` expression.
This `let` expression can be pulled up into a `define` expression.
@@ -99,7 +99,8 @@
(struct m (x))
(define val (m 1))

(define thunk (λ () 1))
(define (thunk)
Copy link
Member

Choose a reason for hiding this comment

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

I dislike that this is two lines.

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.

1 participant