diff --git a/pkgs/redex-pkgs/redex-lib/redex/private/matcher.rkt b/pkgs/redex-pkgs/redex-lib/redex/private/matcher.rkt index adcb675bec..b3255def25 100644 --- a/pkgs/redex-pkgs/redex-lib/redex/private/matcher.rkt +++ b/pkgs/redex-pkgs/redex-lib/redex/private/matcher.rkt @@ -621,8 +621,7 @@ See match-a-pattern.rkt for more details ;; match-pattern? : compiled-pattern exp -> boolean (define (match-pattern? compiled-pattern exp) - (let ([results ((compiled-pattern-cp compiled-pattern) exp #f)]) - (and results #t))) + (and (match-pattern compiled-pattern exp) #t)) ;; match-pattern : compiled-pattern exp -> (union #f (listof bindings)) (define (match-pattern compiled-pattern exp) diff --git a/pkgs/redex-pkgs/redex-test/redex/tests/tl-test.rkt b/pkgs/redex-pkgs/redex-test/redex/tests/tl-test.rkt index 5c4bbff208..252e09af4b 100644 --- a/pkgs/redex-pkgs/redex-test/redex/tests/tl-test.rkt +++ b/pkgs/redex-pkgs/redex-test/redex/tests/tl-test.rkt @@ -280,6 +280,9 @@ (test (map match-bindings (redex-match grammar (a ..._1) (term (a a a)))) '(())) + ;; make sure redex-match? does the equality check + (test (redex-match? empty-language (any_0 any_0) (term (1 2))) #f) + (define-syntax (test-match stx) (syntax-case stx () [(_ actual (((var val) ...) ...))