Skip to content

Handle multiple variables in define-let-to-double-define #627

@jackfirth

Description

@jackfirth

The define-let-to-double-define rule can rewrite this:

(define a
  (let ([b 1])
    (+ b 10)))

to this:

(define b 1)
(define a (+ b 10))

But it can't rewrite this:

(define a
  (let ([b 1] [c 2])
    (+ b c 10)))

to this:

(define b 1)
(define c 2)
(define a (+ a b 10))

But that's a valuable refactoring to do, as seen here. The rule should also be renamed to define-let-to-multi-define since this could produce several definitions.

Metadata

Metadata

Assignees

Labels

autopilot-candidateThe Copilot Agent should attempt this during a scheduled Autopilot runexisting lintIssues or pull requests relating to existing lints

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions