core.match

different semantics at runtime versus compile time

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

((fn [x] (match x [1 1] 1 :else 2)) [1]) ->
2

(match [1] [1 1] 1 :else 2) ->
AssertionError Pattern row 1: Pattern row has differing number of patterns.

Activity

Hide
David Nolen added a comment -

This is not actually a bug, but perhaps an unfortunate side effect of a syntactic convenience. When using the vector syntax you not matching on a vector - just a list of local bindings. So in the first case you're matching a specific local binding, and in the second your matching a single value.

Show
David Nolen added a comment - This is not actually a bug, but perhaps an unfortunate side effect of a syntactic convenience. When using the vector syntax you not matching on a vector - just a list of local bindings. So in the first case you're matching a specific local binding, and in the second your matching a single value.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: