Fork me on GitHub
#specter
<
2017-10-30
>
eoliphant02:10:52

hi i’ve got a quick path/select question. In the following code

(def testdata {:a
               {:b [{:c :d}
                    {:e :f}
                    {:g :h}]}})
I’d like to select out :f based on the fact that I know the {:e :f} map’s index I get this far (s/select [:a :b (s/srange 1 2)] testdata) But can’t figure out what to add to the rest of the path

eoliphant03:10:46

ah.. yeah that does it. thanks!

nathanmarz03:10:33

@eoliphant worth skimming through this page to see all the navigators that come with specter https://github.com/nathanmarz/specter/wiki/List-of-Navigators

eoliphant13:10:43

hi @nathanmarz yeah re-read them after your help on that one. I’d skimmed them before I started coding and really ‘got it’ lol. Really great tool. I’ve used lenses in Scala, which cover some of what Specter does. Clojure just makes everything better lol. Specter is a much needed bit of special sauce, I’m working on a pretty complex dynamic forms app, that needs a lot of deep structure querying/manipulation, spent the past 2 days ripping out all of my existing code for use cases that Specter covers