-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
base: master
Are you sure you want to change the base?
Conversation
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 " " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bad...
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
Resyntax fixed 20 issues in 7 files.
map-to-for
let-to-define
provide/contract-to-contract-out
if-let-to-cond
quasiquote-to-list
make-temporary-directory-migration
or-hash-ref-set!-to-hash-ref!
cond-let-to-cond-define
arrow-contract-with-rest-to-arrow-contract-with-ellipses
string-append-and-string-join-to-string-join
define-syntax-syntax-rules-to-define-syntax-rule
always-throwing-if-to-when