resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

New lint: `and` with `let` to `cond`

Open jackfirth opened this issue 1 year ago • 0 comments

As brought up here, it might be nice to have a rule for turning and into cond when doing so allows turning let into define.

#lang resyntax/test

--------------------
#lang racket
(and (condition)
     (let ([x 42])
       (* x 2)))
--------------------
--------------------
#lang racket
(cond
 [(condition)
  (define x 42)
  (* x 2)]
 [else #false])
--------------------

jackfirth avatar Oct 15 '24 21:10 jackfirth