(let* ([f (new frame% (label "Break DrRacket"))]
[b (new button%
(label "Break Main Thread")
(callback
(λ (x y)
(break-thread to-break)))
(parent f))]
[b (new button%
(label "Break All Threads")
(callback
(λ (x y)
((dynamic-require 'drracket/private/key 'break-threads))))
(parent f))])
(send f show #t))
Resyntax won't rewrite this let* to define because it sees that the b identifier is bound twice. However, the b identifier is unused, so a better rewrite would be to change it to this:
(define f (new frame% (label "Break DrRacket")))
(new button%
(label "Break Main Thread")
(callback
(λ (x y)
(break-thread to-break)))
(parent f))
(new button%
(label "Break All Threads")
(callback
(λ (x y)
((dynamic-require 'drracket/private/key 'break-threads))))
(parent f))
(send f show #t)
The let* to define refactoring rules should consider these cases.
Saw this code today:
Resyntax won't rewrite this
let*
todefine
because it sees that theb
identifier is bound twice. However, theb
identifier is unused, so a better rewrite would be to change it to this:The
let*
todefine
refactoring rules should consider these cases.