-
-
Notifications
You must be signed in to change notification settings - Fork 92
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 #714
base: master
Are you sure you want to change the base?
Conversation
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
The `provide/contract` form is a legacy form made obsolete by `contract-out`.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This `if` expression can be refactored to an equivalent expression using `and`.
The `else` clause of this `cond` expression is another `cond` expression and can be flattened.
Use the `#:when` keyword instead of `when` to reduce loop body indentation.
This method chain made of nested `send` expressions can be written more clearly as a `send+` expression.
Use `make-temporary-directory` to make directories instead of `make-temporary-file`.
[use-get/put-dialog (-> (-> any) path? void?)] | ||
[set-module-language! (->* () (boolean?) void?)]) | ||
(provide (contract-out [use-get/put-dialog (-> (-> any) path? void?)] | ||
[set-module-language! (->* () (boolean?) void?)])) |
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 seems like another situation where we are missing some newlines.
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.
(raise x))]) | ||
(fw:preferences:set 'framework:file-dialogs 'common) | ||
(open-dialog) | ||
(let ([dlg (wait-for-new-frame drs)]) |
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.
How come this let
didn't go away?
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.
We have been asking this a lot. I think one thing that would help is for the PR description to indicate if there's any limitation reached. If so, we wouldn't need to ask anymore if it's Resyntax's fault or not when some issues are not fixed.
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.
That sounds like a great idea.
|
||
(clear-definitions drr-frame) | ||
(do-execute drr-frame) | ||
(queue-callback/res (λ () (+ 1 (send ints-text last-position)))) |
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.
Wow, this can just go away!
(drracket-frame? active)) | ||
active | ||
#f)) | ||
(and (and active (drracket-frame? active)) active)) |
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.
we only need one and
here, but maybe that's out of the scope of this improvement?
(drracket-frame? active)) | ||
active | ||
#f)) | ||
(and (and active (drracket-frame? active)) active)) |
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.
ditto (copied code, I wonder?!)
[(method-in-interface? 'get-stacks (object-interface snip)) | ||
(define-values (s1 s2) (send snip get-stacks)) | ||
(list* s1 s2 (loop (send snip next)))] | ||
[else (loop (send snip next))]))))) |
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 one is not a good change. This is going against the data definition. That is, the outer cond is part of the processing of snip
(there are two cases for the input and, in the second case of the input, I want to do a conditional thing).
@@ -64,7 +64,7 @@ and then loading the framework after that. | |||
(define drr-frame (wait-for-drracket-frame)) | |||
(set-module-language! drr-frame) | |||
(queue-callback/res | |||
(λ () (send (send (send drr-frame get-definitions-text) get-canvas) focus))) | |||
(λ () (send+ drr-frame (get-definitions-text) (get-canvas) (focus)))) |
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.
I don't think this one is a good change, actually. It isn't like the example in the documentation for send+
where we're getting objects of the same type back and doing functional update.
Resyntax fixed 20 issues in 6 files.
let-to-define
provide/contract-to-contract-out
if-else-false-to-and
when-expression-in-for-loop-to-when-keyword
cond-else-cond-to-cond
send-chain-to-send+
make-temporary-directory-migration
cond-let-to-cond-define