From e1eb4a4b9351364d4a532e6b4b6fc04875e61c9b Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 17 Mar 2010 18:21:09 +0000 Subject: [PATCH] Fix bug in match reported by jay. svn: r18563 --- collects/scheme/match/compiler.ss | 2 +- collects/tests/match/examples.ss | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/collects/scheme/match/compiler.ss b/collects/scheme/match/compiler.ss index 11d260774b..58a7260617 100644 --- a/collects/scheme/match/compiler.ss +++ b/collects/scheme/match/compiler.ss @@ -206,7 +206,7 @@ #:when (for/and ([seen-var seen]) (not (free-identifier=? bv (car seen-var))))) bv)]) - (with-syntax ([(success? var ...) (append (generate-temporaries '(success?)) vars)]) + (with-syntax ([(esc* success? var ...) (append (generate-temporaries '(esc* success?)) vars)]) ;; do the or matching, and bind the results to the appropriate ;; variables #`(let ([esc* (lambda () (values #f #,@(for/list ([v vars]) #'#f)))]) diff --git a/collects/tests/match/examples.ss b/collects/tests/match/examples.ss index acb752751b..2348230173 100644 --- a/collects/tests/match/examples.ss +++ b/collects/tests/match/examples.ss @@ -633,5 +633,15 @@ (match (make-pose 1 2 3) [(struct pose (x y a)) "Gotcha!"] [else "Epic fail!"]))) + + (comp #f + (match (list 'a 'b 'c) + [(or (list a b) + (and (app (lambda _ #f) b) + (or (and (app (lambda _ #f) a) + (list)) + (list a)))) + #t] + [_ #f])) ))