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

cond should be refactored to when or unless when applicable #420

Closed
jackfirth opened this issue Nov 24, 2024 · 0 comments · Fixed by #423
Closed

cond should be refactored to when or unless when applicable #420

jackfirth opened this issue Nov 24, 2024 · 0 comments · Fixed by #423
Labels
new lint Issues suggesting new lints or pull requests implementing new lints

Comments

@jackfirth
Copy link
Owner

jackfirth commented Nov 24, 2024

#lang resyntax/test

test: "cond should be refactorable to unless when equivalent"
--------------------
#lang racket
(define (f)
  (cond
    [c (void)]
    [else
     (define x 42)
     (* x 2)]))
--------------------
--------------------
#lang racket
(define (f)
  (unless c
    (define x 42)
    (* x 2)))
--------------------

Saw this in racket/drracket#698.

@jackfirth jackfirth added the new lint Issues suggesting new lints or pull requests implementing new lints label Nov 24, 2024
jackfirth added a commit that referenced this issue Nov 24, 2024
jackfirth added a commit that referenced this issue Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new lint Issues suggesting new lints or pull requests implementing new lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant