On this page:
8.18
top
← prev up

ResyntaxπŸ”— i

(require resyntax ) package: resyntax

Resyntax is a refactoring tool for Racket. The tool can be guided by refactoring rules, which are macro-like functions defined in terms of syntax-parse that specify how to search for and refactor different coding patterns. Resyntax comes with a standard set of refactoring rules that improve code written in #lang racket or #lang racket/base. For example, consider the following program:

"my-program.rkt"

(define (swapxy)
(let ([t(unbox x)])
(set-box! x(unbox y))
(set-box! yt)))

This program uses let unnecessarily. The let expression can be replaced with a define form, reducing the indentation of the code. Resyntax is capable of detecting and automatically fixing this issue. Running resyntax fix --file my-program.rkt rewrites the above to the following:

"my-program.rkt"

(define (swapxy)
(define t(unbox x))
(set-box! x(unbox y))
(set-box! yt))

To see a list of suggestions that Resyntax would apply, use resyntax analyze instead of resyntax fix. Each suggestion includes an explanation of why the change is being recommended.

top
← prev up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /