There's currently no support for matching sets and I have no plans in the
near future. Patch welcome, it could be matched and optimized similarly to
map matching.

On Thursday, October 10, 2013, Phillip Lord wrote:

>
> I've been playing with core.match recently. One thing that I am confused
> about is, I cannot match over a set (based on membership), unless I
> convert into a map first.
>
> So, for example....
>
> (defn map-set [set]
>   (into {}
>         (for [k set]
>           [k k])))
>
> (let [x (map-set #{:a :b :c})]
>   (match
>    [x]
>    [{:a _ :b _}] 'match_a_b
>    :else nil))
>
>
> returns 'match_a_b
>
> Both of these...
>
> (let [y #{:a :b :c}]
>   (match
>    [y]
>    [{:a _ :b _}] 'match_a_b
>    :else nil))
>
> (let [z #{:a :b :c}]
>   (match
>    [z]
>    [#{:a :b}] 'match_a_b
>    :else nil))
>
> returns nil. Am I missing something obvious?
>
> Phil
>
> --
> --
> 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<javascript:;>
> 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 <javascript:;>
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com <javascript:;>.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to