diff --git a/collects/mzlib/private/match/ddk-handlers.ss b/collects/mzlib/private/match/ddk-handlers.ss index 8966285026..aee79706f7 100644 --- a/collects/mzlib/private/match/ddk-handlers.ss +++ b/collects/mzlib/private/match/ddk-handlers.ss @@ -93,7 +93,7 @@ bv)) #,(let ([new-var (gensym 'exp)]) #`(let ([#,new-var (car #,exp-name)]) - #,(next-outer #'the-pat + #,(next-outer* #'the-pat #`#,new-var sf ;(append (map cons bound new-vars) bv) @@ -103,19 +103,26 @@ ;; bindings let-bound kf - (lambda (sf bv) - #`(#,loop-name - (cdr #,exp-name) - #,@(map - (lambda - (b-var - bindings-var) - #`(cons - #,(get-bind-val - b-var - bv) - #,bindings-var)) - bound binding-list-names))) + (lambda (let-bound) + (lambda (sf bv) + ;(printf "let-bound is: ~a~n" let-bound) + ;(printf "bv is: ~a ~a~n" + ; (map syntax-e (map car bv)) + ; (map syntax-object->datum (map cdr bv))) + #`(#,loop-name + (cdr #,exp-name) + #,@(map + (lambda + (b-var + bindings-var) + (subst-bindings + #`(cons + #,(get-bind-val + b-var + bv) + #,bindings-var) + let-bound)) + bound binding-list-names)))) cert))))))])))) (define (new-emit f) (emit f ae let-bound sf bv kf ksucc)) (case k diff --git a/collects/mzlib/private/match/getbindings.ss b/collects/mzlib/private/match/getbindings.ss index 5dc9fb3393..0d996998ca 100644 --- a/collects/mzlib/private/match/getbindings.ss +++ b/collects/mzlib/private/match/getbindings.ss @@ -41,6 +41,19 @@ (next-outer-helper p ae sf bv let-bound (lambda (x) kf) (lambda (a b) ks) cert stx)) + (define/opt (next-outer* + p + ae ;; this is the actual expression + sf + bv + let-bound + kf + ks + cert + [stx (syntax '())]) + (next-outer-helper p ae sf bv let-bound + (lambda (x) kf) (lambda (a b) (ks b)) cert stx)) + ;;!(function next-outer-helper ;; (form (next-outer p ae sf bv let-bound kf-func ks-func syntax bool) ;; -> diff --git a/collects/mzlib/private/match/render-sigs.ss b/collects/mzlib/private/match/render-sigs.ss index 1792869207..a75552deeb 100644 --- a/collects/mzlib/private/match/render-sigs.ss +++ b/collects/mzlib/private/match/render-sigs.ss @@ -7,6 +7,6 @@ (define-signature ddk-handlers^ (handle-end-ddk-list handle-inner-ddk-list handle-ddk-vector handle-ddk-vector-inner)) - (define-signature getbindings^ (getbindings create-test-func next-outer)) + (define-signature getbindings^ (getbindings create-test-func next-outer next-outer*)) ) \ No newline at end of file