I *think* this is because when there are multiple matches, the most
specialized matches and 1 is less generic than _
On Mon, Oct 3, 2011 at 12.39 PM, "Sunil S Nandihalli" <
sunil.nandiha...@gmail.com> wrote:
>
> If I remove the line [{:a 1 :c _}] :a1 it returns :a-1 .. So, I guess it
means that the behavior is undefined if there are multiple matches.
> Sunil.
>
> On Mon, Oct 3, 2011 at 3:57 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
>>
>> Hello everybody,
>>  I was playing with core.match library and I notice the
following behavior
>>
>> let [x {:a 1 :b 2 :c 10 :d 30}]
>>              (match [x]
>>                [({:a _ :b _ :c _ :d _} :only [:a :b :c :d])] :a-1
>>                [({:a _ :b 2} :only [:a :b])] :a0
>>                [{:a 1 :c _}] :a1
>>                [{:c 3 :d _ :e 4}] :a2
>>                :else []))
>>
>> returns
>> :a1
>> I was hoping to get
>> :a-1
>>
>> Am I using it wrong? Have I misunderstood as to how match is supposed to
work? It looks like match assumes either that there is always a unique match
or it does not guarantee that it will the try matches in the order
specified. Can somebody help?
>>
>> Thanks,
>> Sunil.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to