This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-04
Channels
- # admin-announcements (1)
- # alda (2)
- # beginners (52)
- # boot (8)
- # cider (14)
- # cljs-dev (7)
- # cljsrn (5)
- # clojure (4)
- # clojure-belgium (2)
- # clojure-brasil (1)
- # clojure-dev (8)
- # clojure-greece (6)
- # clojure-russia (34)
- # clojure-spec (42)
- # clojurescript (20)
- # cursive (5)
- # funcool (1)
- # hoplon (313)
- # immutant (1)
- # lambdaisland (24)
- # mount (1)
- # om (26)
- # perun (1)
- # planck (2)
- # proton (1)
- # protorepl (6)
- # pure-frame (15)
- # re-frame (14)
- # specter (17)
- # spirituality-ethics (1)
is there anything in specter that would allow me to do the following without resorting to the core functions I'm currently using:
(reduce + (map count (select [VALS] {:a [1 2 3] :b [5 6]})))
, or
(reduce + (vals (transform [VALS] count {:a [1 2 3] :b [5 6]})))
?
is this what you want? (select-one [(subselect ALL LAST ALL) (view count)] DATA)
you could also do (count (select [ALL LAST ALL] DATA))
I'm in a phase where I'm trying to figure out where the line between using specter to do things, and having to break out of it to use the core functions is
that line is probably quite high once you get familiar with all the features packed in 🙂
I'm still in that phase 🙂
the line has gotten higher and higher over time as I've realized how many things can be expressed elegantly in terms of navigation
it feels a bit like when I first got comfortable with thinking about all Clojure problems as just transforming data back and fourth beetween the core data types and functions, it feels great!
assuming your learning trajectory is similar to what mine was, prepare for a very rewarding ride
a big moment for me was figuring out the "sub{x}" navigators
subset and then subgraph
(defn NAV-SUBMAT [i j rows cols] [specter/ALL (specter/srange i (+ i cols)) [(specter/srange j (+ j rows)) specter/ALL]])