Skip to content

Commit 7e9a461

Browse files
committed
fix error in 1328459
1 parent 4d873e2 commit 7e9a461

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

redex-lib/redex/private/binding-forms.rkt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,7 @@ to traverse the whole value at once, rather than one binding form at a time.
640640
[redex-val redex-val])
641641
(define maybe-car (if (value-with-spec? redex-val) values car))
642642
(define maybe-cdr (if (value-with-spec? redex-val) values cdr))
643-
(define maybe-drop (if (value-with-spec? redex-val) values drop))
644-
(define maybe-take (if (value-with-spec? redex-val) values take))
643+
(define maybe-drop (if (value-with-spec? redex-val) (λ (x y) x) drop))
645644
(match body
646645
;; I thought that `rename-reference`ing this subterm of the current form was
647646
;; going to be a problem: `rename-reference` doesn't have any idea about the
@@ -657,13 +656,18 @@ to traverse the whole value at once, rather than one binding form at a time.
657656

658657
[`(,(.../internal sub-body driving-names) . ,body-rest)
659658
(define red-match-under-... (pass-... red-match driving-names))
660-
661-
`(,@(map (λ (sub-red-match sub-freshened-subterms redex-val)
662-
(loop sub-red-match sub-freshened-subterms sub-body redex-val))
663-
red-match-under-...
664-
(pass-... freshened-subterms driving-names (length red-match-under-...))
665-
(maybe-take redex-val (length red-match-under-...)))
666-
659+
(define fst
660+
(if (value-with-spec? redex-val)
661+
(map (λ (sub-red-match sub-freshened-subterms)
662+
(loop sub-red-match sub-freshened-subterms sub-body redex-val))
663+
red-match-under-...
664+
(pass-... freshened-subterms driving-names (length red-match-under-...)))
665+
(map (λ (sub-red-match sub-freshened-subterms redex-val)
666+
(loop sub-red-match sub-freshened-subterms sub-body redex-val))
667+
red-match-under-...
668+
(pass-... freshened-subterms driving-names (length red-match-under-...))
669+
(take redex-val (length red-match-under-...)))))
670+
`(,@fst
667671
. ,(loop red-match freshened-subterms body-rest
668672
(maybe-drop redex-val (length red-match-under-...))))]
669673

0 commit comments

Comments
 (0)