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

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

Automated Resyntax fixes #476

wants to merge 12 commits into from

Conversation

resyntax-ci[bot]
Copy link
Contributor

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

Resyntax fixed 20 issues in 7 files.

  • Fixed 5 occurrences of map-to-for
  • Fixed 4 occurrences of let-to-define
  • Fixed 2 occurrences of provide/contract-to-contract-out
  • Fixed 1 occurrence of if-let-to-cond
  • Fixed 1 occurrence of quasiquote-to-list
  • Fixed 1 occurrence of make-temporary-directory-migration
  • Fixed 1 occurrence of or-hash-ref-set!-to-hash-ref!
  • Fixed 1 occurrence of cond-let-to-cond-define
  • Fixed 1 occurrence of arrow-contract-with-rest-to-arrow-contract-with-ellipses
  • Fixed 1 occurrence of string-append-and-string-join-to-string-join
  • Fixed 1 occurrence of define-syntax-syntax-rules-to-define-syntax-rule
  • Fixed 1 occurrence of always-throwing-if-to-when

resyntax-ci bot added 12 commits January 15, 2025 00:16
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `map` operation can be replaced with a `for/list` loop.
This expression can be replaced with a simpler, equivalent `hash-ref!` expression.
This use of `string-append` can be removed by using `string-join`'s keyword arguments.
Using `when` and `unless` is simpler than a conditional with an always-throwing branch.
This quasiquotation is equialent to a simple `list` call.
This `define-syntax` macro can be replaced with a simpler, equivalent `define-syntax-rule` macro.
`cond` with internal definitions is preferred over `if` with `let`, to reduce nesting
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
The `provide/contract` form is a legacy form made obsolete by `contract-out`.
…ellipses`

This `->*` contract can be rewritten using `->` with ellipses.
Use `make-temporary-directory` to make directories instead of `make-temporary-file`.
@@ -65,7 +65,9 @@
`(" " ,@(decode-content (list location)) ,(if date "," "."))
null)
(if date `(" " ,@(decode-content (list date)) ".") null)
(if url `(" " ,(link url (tt url))) null)
(if url (list " "
Copy link
Contributor

Choose a reason for hiding this comment

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

This is bad...

Copy link
Contributor

Choose a reason for hiding this comment

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

@jackfirth I think this occurs because Resyntax invokes range formatting on only the subexpression, so it doesn't format the entire if expression...

(Actually fmt ideally should collapse (list " " (link url (tt url))) into one line, circumventing this issue, but without shadowing, link is a special form that should be formatted vertically, so that's why fmt introduces a newline)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's definitely the cause. I'm not sure how to fix it from the Resyntax side.

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