Skip to content

Conversation

resyntax-ci[bot]
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Oct 5, 2025

Resyntax fixed 20 issues in 3 files.

  • Fixed 7 occurrences of let-to-define
  • Fixed 3 occurrences of string-append-with-format-to-format
  • Fixed 3 occurrences of for-each-to-for
  • Fixed 1 occurrence of and-let-to-cond
  • Fixed 1 occurrence of andmap-to-for/and
  • Fixed 1 occurrence of quasiquote-to-list
  • Fixed 1 occurrence of define-lambda-to-define
  • Fixed 1 occurrence of nested-when-to-compound-when
  • Fixed 1 occurrence of define-lambda-to-curried-define
  • Fixed 1 occurrence of map-to-for

resyntax-ci bot added 10 commits October 5, 2025 00:28
Nested `when` expressions can be merged into a single compound `when` expression.
Using `cond` allows converting `let` to internal definitions, reducing nesting
This `map` operation can be replaced with a `for/list` loop.
This `andmap` operation can be replaced with a `for/and` loop.
This `string-append` with `format` expression can be simplified to a single `format` call.
This `for-each` operation can be replaced with a `for` loop.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
The `define` form supports a shorthand for defining functions.
Functions returning lambdas can be written using curried function syntax.
This quasiquotation is equialent to a simple `list` call.
(send (get-frame) hide-error-report))))
(when (and old-error-report-visible? (is-current-tab?))
(send (get-frame) hide-error-report)))

Copy link
Member

Choose a reason for hiding this comment

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

I merged one of these before, but I'm not convinced of this one. The indentation savings in this example isn't serious but the and makes it a bit harder to read, especially since it is all on one line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting. I find this kind of thing more readable because it's easier to check that the code following it is outside the when. But maybe there's some room for nuance about when the rule is worth applying. I'll give it some thought. Let me know if you see other instances of this rule that seem off to you.

Copy link
Member

Choose a reason for hiding this comment

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

In this particular instance it is not helping that the two arguments to the "and" are on the same line. I think I would not see much difference between the two if the revised version had also taken 3 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.

2 participants