core.match

Rest does not work on vectors?

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

Description

(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 & r]] :a2))

Gives "java.lang.IllegalArgumentException: No matching clause: [3 2 3 4]"

(let [v [3 2 3 4]]
  (match [v]
    [[3 & r]] :a2))
=> :a2, as expected

(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 2 3 4]] :a2))
=> :a2, as expected

Activity

David Nolen made changes -
Field Original Value New Value
Description {{
(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 & r]] :a2))

Gives "java.lang.IllegalArgumentException: No matching clause: [3 2 3 4]"

(let [v [3 2 3 4]]
  (match [v]
    [[3 & r]] :a2))
=> :a2, as expected

(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 2 3 4]] :a2))
=> :a2, as expected
}}
{code}
(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 & r]] :a2))

Gives "java.lang.IllegalArgumentException: No matching clause: [3 2 3 4]"

(let [v [3 2 3 4]]
  (match [v]
    [[3 & r]] :a2))
=> :a2, as expected

(let [v [3 2 3 4]]
  (match [v]
    [[1 1 3]] :a0
    [[3 2 3 4]] :a2))
=> :a2, as expected
{code}
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 (1)

Dates

  • Created:
    Updated:
    Resolved: