Fork me on GitHub
#specter
<
2017-10-05
>
hkjels13:10:03

Can I use specter to get the path of some deeply nested key using a predicate? Say I want the path to the last value that’s brown here: {:a "foo" :b :_ :c {:d "brown" :e "bar"} :f [{:g "pale" :h "brown" :i {:j "ale" :k [{:l "brown"} {:l "brown"}]}}]}

nathanmarz13:10:16

@hkjels yes, you use recursive-path and collect-one

hkjels14:10:55

@nathanmarz thanks! I’ll give that a shot Looks like a really good lib

michaelwfogleman16:10:03

@nathanmarz: Just pushed a new version of PR with mutual recursion and the building blocks we've been working on - could use an assist coming up with a better example for mutually recursive paths

nathanmarz17:10:29

@michaelwfogleman I only ever made a mutually recursive path once... and it's way too involved to use as an example

nathanmarz17:10:02

I think just showing the basics of how mutually recursive paths would be structured is sufficient

gdeer8119:10:04

speaking of examples, if anyone has any interesting ones that they want me to turn into a specter koan, just open an issue and paste it in https://github.com/gdeer81/specter-koans/issues

gdeer8119:10:59

or you can just paste your scratchpad and I can mine it for any good nuggets

michaelwfogleman22:10:19

@nathanmarz In that case, the PR should be either pretty close or good to go 🙂