Re: core.match on a set

2013-10-14 Thread Phillip Lord
Well, I had a very quick go at this; getting it to work simply is, actually, remarkable easy. (defmethod emit-pattern clojure.lang.IPersistentSet [pat] pat) (defmethod to-source clojure.lang.IPersistentSet [pat ocr] `(every? identity (map #(contains? ~ocr %) ~pat))) I'm guessing that this i

Re: core.match on a set

2013-10-11 Thread Phillip Lord
Best reasons of all! David Nolen writes: > The only reason it's not currently in there is I've never considered it. > The reason I have no near terms plans for it, lack of time. > > On Friday, October 11, 2013, Phillip Lord wrote: > >> >> Just out of curiosity why? Or am I just wierd in wantin

Re: core.match on a set

2013-10-11 Thread David Nolen
The only reason it's not currently in there is I've never considered it. The reason I have no near terms plans for it, lack of time. On Friday, October 11, 2013, Phillip Lord wrote: > > Just out of curiosity why? Or am I just wierd in wanting this? > > I'll have a look, and see if I can offer a p

Re: core.match on a set

2013-10-11 Thread Phillip Lord
Just out of curiosity why? Or am I just wierd in wanting this? I'll have a look, and see if I can offer a patch, though. Phil David Nolen writes: > 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 similar

Re: core.match on a set

2013-10-10 Thread David Nolen
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 > abou

core.match on a set

2013-10-10 Thread Phillip Lord
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})] (ma