File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,36 @@ test: "multi-accumulator for/fold with one used result refactorable to for/fold
447447------------------------------
448448
449449
450+ test: "multi-accumulator for/fold with one used result refactorable without formatting surroundings "
451+ ------------------------------
452+ (define (foo)
453+ ( displayln "foo " )
454+
455+ (define-values (x y z)
456+ (for/fold ([accum1 0 ]
457+ [accum2 0 ]
458+ [accum3 0 ])
459+ ([n (in-naturals)])
460+ (values 0 0 0 )))
461+
462+ (* x 2 ))
463+ ------------------------------
464+ ------------------------------
465+ (define (foo)
466+ ( displayln "foo " )
467+
468+ (define x
469+ (for/fold ([accum1 0 ]
470+ [accum2 0 ]
471+ [accum3 0 ]
472+ #:result accum1)
473+ ([n (in-naturals)])
474+ (values 0 0 0 )))
475+
476+ (* x 2 ))
477+ ------------------------------
478+
479+
450480test: "for/fold with conditional body refactorable to for/fold with #:when "
451481------------------------------
452482(define (foo)
Original file line number Diff line number Diff line change @@ -336,8 +336,9 @@ return just that result."
336336 (for-id ([accumulator-id initializer] ...
337337 #:result #,used-accumulator)
338338 loop-clauses loop-body ... ))
339+
339340 (body-before ...
340- (~replacement replacement-definition #:original original-definition)
341+ (~focus- replacement-on (~ replacement replacement -definition #:original original-definition) )
341342 body-after ... ))
342343
343344
You can’t perform that action at this time.
0 commit comments