Fork me on GitHub
#specter
<
2017-04-12
>
snacks14:04:32

hi Nathan i have a question

snacks14:04:40

Is there anyway I can use selected? with a selector takes multiple values. for example def data [{:a 1 :b 1 :c 1} {:a 2 :b 1 :c 1}]

snacks14:04:55

I only want to select sub maps where :a = :b

nathanmarz14:04:05

@snacks for that I would just use an anonymous function

nathanmarz14:04:13

#(= (:a %) (:b %))

nathanmarz14:04:02

(def data [{:a 1 :b 1 :c "biubiu"} {:a 1 :b 2 :c 3}])
(select [ALL #(= (:a %) (:b %)) :c] data)
;; => ["biubiu"]

snacks20:04:01

why is it called specter?

nathanmarz20:04:39

@snacks from "introspect"

nathanmarz20:04:39

it was also released before clojure.spec was a thing, would choose a different name if I made it today

souenzzo22:04:23

And com.rpl.specter was related with ?

nathanmarz23:04:47

@souenzzo no, my company is called Red Planet Labs

nathanmarz23:04:00

no website yet