-
-
Notifications
You must be signed in to change notification settings - Fork 102
Automated Resyntax fixes #1450
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
base: master
Are you sure you want to change the base?
Automated Resyntax fixes #1450
Conversation
This `match` expression can be simplified using `match-define`.
This `map` operation can be replaced with a `for/list` loop.
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
This variable is returned immediately and can be inlined.
This `if` expression can be refactored to an equivalent expression using `and`.
The `else`-`if` branch of this `cond` expression can be collapsed into the `cond` expression.
This `let` expression can be pulled up into a `define` expression.
This expression is equivalent to calling the `negative?` predicate.
([dom (in-list dom*)] | ||
#:when (pair? dom)) | ||
(cons (cdr dom) acc))) | ||
(define check* (protect-loop rst dom+)) |
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.
Another for/reverse
[range-stx (if range #`(values #,@(map f range)) #'any)]) | ||
#'(arg-stx ... rest-stx ... . -> . range-stx))])) | ||
(match-define (arr-combinator (arr-seq args rest range)) v) | ||
(with-syntax ([(arg-stx ...) (map f args)] |
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.
Should resyntax use define/with-syntax
?
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.
cc @jackfirth
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've considered it. The opportunity doesn't seem to come up much though.
(map f* vals) | ||
(and call-cc (map f* call-cc)))])) | ||
(match-define (pt-seq vals call-cc) seq) | ||
(define (f* a) |
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 really want a way to turn this formatting decision off.
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 function in particular hardly seems worth defining at all.
Resyntax fixed 50 issues in 18 files.
single-clause-match-to-match-define
let-to-define
define-let-to-double-define
inline-unnecessary-define
zero-comparison-to-negative?
map-to-for
cond-else-if-to-cond
if-else-false-to-and