Skip to content

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

@jackfirth

Description

@jackfirth
#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new lintIssues suggesting new lints or pull requests implementing new lints

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions