Re: set/select vs. other set functions: argument order and ->

2010-02-04 Thread wlr
Well, I think you've exposed an inconsistency in the signature of clojure.set/select vis-a-vis the "collection first, sequence last" principles here: http://groups.google.com/group/clojure/msg/a8866d34b601ff43 It seems that the collection function clojure.set/select is patterned after the sequenc

Re: set/select vs. other set functions: argument order and ->

2010-02-04 Thread Tayssir John Gabbour
On Feb 4, 3:31 am, wlr wrote: > (-> #{{:a 1, :b 1, :c 1} >{:a 2, :b 2, :c 2} >{:a 3, :b 3, :c 3}} >(->> (select #(= (:a %) 1))) >(project [:b :c])) > > => #{{:c 1, :b 1}} Ahhh.. what a tricky language. ;) This saves me from writing reverse- args or select*,

Re: set/select vs. other set functions: argument order and ->

2010-02-03 Thread wlr
On Feb 3, 6:41 pm, Tayssir John Gabbour wrote: > ;; Works, but is ugly. > (let [xset  #{{:a 1, :b 1, :c 1} >               {:a 2, :b 2, :c 2} >               {:a 3, :b 3, :c 3}}] >   (project (select #(= (:a %) 1) xset) >            [:b :c])) > > So what I currently do is this: > > ;; Works, with

Re: set/select vs. other set functions: argument order and ->

2010-02-03 Thread Tayssir John Gabbour
On Feb 3, 10:41 pm, wlr wrote: > Can you somehow use ->> ? > > user> (->> #{1 2 3 4} (clojure.set/select even?)) > #{2 4} D'oh, I was terribly unclear. I want to do something neat and pretty like: ;; Doesn't work! (-> #{{:a 1, :b 1, :c 1} {:a 2, :b 2, :c 2} {:a 3, :b 3, :c 3}} (s

Re: set/select vs. other set functions: argument order and ->

2010-02-03 Thread wlr
Can you somehow use ->> ? user> (->> #{1 2 3 4} (clojure.set/select even?)) #{2 4} Walt -- 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 -