Skip to content

Commit

Permalink
MATCH-83 & MATCH-84: vector patterns with rest pattern broken
Browse files Browse the repository at this point in the history
aim for correctness, the attempt to share tests between vector
patterns with and without rest patterns was problematic. We'll
reconsider this optimization at some future point.
  • Loading branch information
swannodette committed Jul 25, 2013
1 parent 0430c6c commit ae2bc9c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/clojure/clojure/core/match.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1595,11 +1595,8 @@ col with the first column and compile the result"


(defmethod groupable? [VectorPattern VectorPattern] (defmethod groupable? [VectorPattern VectorPattern]
[a b] [a b]
(cond (and (= (:rest? a) (:rest? b))
(= (:size a) (:size b)) true (= (:size a) (:size b))))
(and (:rest? a) (<= (:size a) (:size b))) true
(and (:rest? b) (<= (:size b) (:size a))) true
:else false))


;; ============================================================================= ;; =============================================================================
;; # Interface ;; # Interface
Expand Down

0 comments on commit ae2bc9c

Please sign in to comment.