File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
default-recommendations/loops Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1010
1111
1212(require resyntax/base
13+ racket/list
1314 resyntax/default-recommendations/analyzers/identifier-usage
1415 resyntax/default-recommendations/let-replacement/private/let-binding
1516 resyntax/default-recommendations/private/lambda-by-any-name
2930 (_:lambda-by-any-name (x:id)
3031 original-body:body-with-refactorable-let-expression)
3132 #:with (multi-body ... ) #'(original-body.refactored ... )
32- #:attr [prefix-forms 1 ] (attribute original-body.refactored)
33- #:attr result-form #'(begin )
33+ #:do [(define refactored-forms (attribute original-body.refactored))
34+ (define prefix-list (if (null? refactored-forms) '() (drop-right refactored-forms 1 )))
35+ (define result (if (null? refactored-forms) #'(begin ) (last refactored-forms)))]
36+ #:attr [prefix-forms 1 ] prefix-list
37+ #:attr result-form result
3438 #:attr single-body #'(begin original-body.refactored ... ))
3539
3640 ;; Lambdas with multiple body forms (two or more)
You can’t perform that action at this time.
0 commit comments