Skip to content

Commit

Permalink
we need to pass everything along since we don't have backtracking,
Browse files Browse the repository at this point in the history
match-order-6-recur however still failing.
  • Loading branch information
swannodette committed Jun 14, 2013
1 parent c975778 commit 2998fca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/main/clojure/clojure/core/match.clj
Expand Up @@ -604,10 +604,7 @@
(if-not *recur-present*
[(pattern-matrix (take n rows) ocrs)
(pattern-matrix (drop n rows) ocrs)]
[(pattern-matrix
(concat (take n rows)
(drop-while #(not (wildcard-pattern? (first %))) rows))
ocrs)
[(pattern-matrix rows ocrs)
(pattern-matrix (drop n rows) ocrs)])))

(defn default-matrix [matrix]
Expand Down
3 changes: 2 additions & 1 deletion src/test/clojure/clojure/core/match/test/impl.clj
Expand Up @@ -108,7 +108,7 @@

(deftest test-matrix-splitter-recur-1
(testing "for Maranget example, show specialized matrix and default
matrix are as expected in the presence of recur."
matrix are as expected in the presence of recur."
(let [m1 (build-matrix [y x z]
[false _ true ] (recur x y z 1)
[true false _ ] (recur x y z 2)
Expand All @@ -117,6 +117,7 @@
:else 5)
S (build-matrix [y x z]
[false _ true ] (recur x y z 1)
[true false _ ] (recur x y z 2)
[_ _ false] (recur x y z 3)
[_ _ true ] (recur x y z 4)
:else 5)
Expand Down

0 comments on commit 2998fca

Please sign in to comment.