Skip to content

Conversation

@resyntax-ci
Copy link
Contributor

@resyntax-ci resyntax-ci bot commented Apr 13, 2025

Resyntax fixed 20 issues in 4 files.

  • Fixed 14 occurrences of let-to-define
  • Fixed 2 occurrences of comparison-of-difference-and-zero-to-direct-comparison
  • Fixed 1 occurrence of if-let-to-cond
  • Fixed 1 occurrence of send-chain-to-send+
  • Fixed 1 occurrence of nested-if-to-cond
  • Fixed 1 occurrence of inverted-when

resyntax-ci bot added 6 commits April 13, 2025 00:34
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
`cond` with internal definitions is preferred over `if` with `let`, to reduce nesting
…parison`

This comparison can be replaced with a simpler, more direct comparison.
This negated `when` expression can be replaced by an `unless` expression.
This method chain made of nested `send` expressions can be written more clearly as a `send+` expression.
This `if`-`else` chain can be converted to a `cond` expression.
(<= 0 (- (send event get-y) y)))
(if (and (> (send event get-x) x)
(> (send event get-y) y))
(when (not hit?)
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look right. If we say (send event get-x) is b then we are doing something like this:

(<= 0 (- b x))
 ;; add x to both sides
(<= x b)
;; (attempt to) reverse the order of the comparison
(> b x)

but this isn't equivalent when b is equal to x

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jackfirth
Copy link
Collaborator

Closing since it produced a buggy change.

@jackfirth jackfirth closed this Apr 18, 2025
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.

3 participants