<< Back to previous view

[MATCH-20] Doesn't match 'head & tail' in vector matching. Created: 29/Sep/11  Updated: 28/Jul/13  Resolved: 02/Oct/11

Status: Closed
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nikita Beloglazov Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Following code:

(match [[:plus 1 2 3]]
[[:pow arg pow]] 0
[[:plus & args]] 1
:else 2)

Returns 2, but must return 1.

If we delete first clause it works:

(match [[:plus 1 2 3]]
[[:plus & args]] 1
:else 2)

Returns 1.



 Comments   
Comment by Nikita Beloglazov [ 01/Oct/11 1:11 PM ]

Also works with [:plus 1 2] - vector size is now 3, was 4:

(match [[:plus 1 2]]
  [[:pow arg pow]] 0
  [[:plus & args]] 1
  :else 2)
=> 1
Comment by David Nolen [ 01/Oct/11 1:13 PM ]

I have a pretty good idea what's wrong here as well as the fix. Hope to get this resolved in the next couple of days.

Comment by David Nolen [ 02/Oct/11 12:25 PM ]

Fixed, https://github.com/clojure/core.match/commit/02f2ab62cba3d1017c2590b04946cb2c92190635

Generated at Fri Apr 18 08:17:36 CDT 2014 using JIRA 4.4#649-r158309.