core.match

Inconsistent [_ & _] behavior

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    clojure 1.5.1
    core.match 0.2.0-rc4

Description

(let [x [1 2]]
  (match x 
    [0 _ _ _] :a 
    [1 & _] :b 
    _ :c)) ; :c

(let [x [1 2]]
  (match x
    [1 & _] :b 
    [0 _ _ _] :a 
    _ :c)) ; :b

Both clojure and clojurescript

Activity

David Nolen made changes -
Field Original Value New Value
Description (let [x [1 2]], (match x, [0 _ _ _] :a [1 & _] :b _ :c)) ; :c
(let [x [1 2]], (match x, [1 & _] :b [0 _ _ _] :a _ :c)) ; :b

Both clojure and clojurescript
{code}
(let [x [1 2]]
  (match x
    [0 _ _ _] :a
    [1 & _] :b
    _ :c)) ; :c

(let [x [1 2]]
  (match x
    [1 & _] :b
    [0 _ _ _] :a
    _ :c)) ; :b
{code}

Both clojure and clojurescript
David Nolen made changes -
Priority Major [ 3 ] Critical [ 2 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: